offers.proto 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.channel.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/channel/v1/common.proto";
  19. import "google/cloud/channel/v1/products.proto";
  20. import "google/protobuf/timestamp.proto";
  21. import "google/type/money.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "OffersProto";
  25. option java_package = "com.google.cloud.channel.v1";
  26. // Constraints type for Promotional offers.
  27. enum PromotionalOrderType {
  28. // Not used.
  29. PROMOTIONAL_TYPE_UNSPECIFIED = 0;
  30. // Order used for new customers, trial conversions and upgrades.
  31. NEW_UPGRADE = 1;
  32. // All orders for transferring an existing customer.
  33. TRANSFER = 2;
  34. // Orders for modifying an existing customer's promotion on the same SKU.
  35. PROMOTION_SWITCH = 3;
  36. }
  37. // Describes how the reseller will be billed.
  38. enum PaymentPlan {
  39. // Not used.
  40. PAYMENT_PLAN_UNSPECIFIED = 0;
  41. // Commitment.
  42. COMMITMENT = 1;
  43. // No commitment.
  44. FLEXIBLE = 2;
  45. // Free.
  46. FREE = 3;
  47. // Trial.
  48. TRIAL = 4;
  49. // Price and ordering not available through API.
  50. OFFLINE = 5;
  51. }
  52. // Specifies when the payment needs to happen.
  53. enum PaymentType {
  54. // Not used.
  55. PAYMENT_TYPE_UNSPECIFIED = 0;
  56. // Prepay. Amount has to be paid before service is rendered.
  57. PREPAY = 1;
  58. // Postpay. Reseller is charged at the end of the Payment cycle.
  59. POSTPAY = 2;
  60. }
  61. // Represents the type for a monetizable resource(any entity on which billing
  62. // happens). For example, this could be MINUTES for Google Voice and GB for
  63. // Google Drive. One SKU can map to multiple monetizable resources.
  64. enum ResourceType {
  65. // Not used.
  66. RESOURCE_TYPE_UNSPECIFIED = 0;
  67. // Seat.
  68. SEAT = 1;
  69. // Monthly active user.
  70. MAU = 2;
  71. // GB (used for storage SKUs).
  72. GB = 3;
  73. // Active licensed users(for Voice SKUs).
  74. LICENSED_USER = 4;
  75. // Voice usage.
  76. MINUTES = 5;
  77. // For IaaS SKUs like Google Cloud Platform, monetization is based on usage
  78. // accrued on your billing account irrespective of the type of monetizable
  79. // resource. This enum represents an aggregated resource/container for all
  80. // usage SKUs on a billing account. Currently, only applicable to Google Cloud
  81. // Platform.
  82. IAAS_USAGE = 6;
  83. // For Google Cloud Platform subscriptions like Anthos or SAP.
  84. SUBSCRIPTION = 7;
  85. }
  86. // Period Type.
  87. enum PeriodType {
  88. // Not used.
  89. PERIOD_TYPE_UNSPECIFIED = 0;
  90. // Day.
  91. DAY = 1;
  92. // Month.
  93. MONTH = 2;
  94. // Year.
  95. YEAR = 3;
  96. }
  97. // Represents an offer made to resellers for purchase.
  98. // An offer is associated with a [Sku][google.cloud.channel.v1.Sku], has a plan for payment, a price, and
  99. // defines the constraints for buying.
  100. message Offer {
  101. option (google.api.resource) = {
  102. type: "cloudchannel.googleapis.com/Offer"
  103. pattern: "accounts/{account}/offers/{offer}"
  104. };
  105. // Resource Name of the Offer.
  106. // Format: accounts/{account_id}/offers/{offer_id}
  107. string name = 1;
  108. // Marketing information for the Offer.
  109. MarketingInfo marketing_info = 2;
  110. // SKU the offer is associated with.
  111. Sku sku = 3;
  112. // Describes the payment plan for the Offer.
  113. Plan plan = 4;
  114. // Constraints on transacting the Offer.
  115. Constraints constraints = 5;
  116. // Price for each monetizable resource type.
  117. repeated PriceByResource price_by_resources = 6;
  118. // Start of the Offer validity time.
  119. google.protobuf.Timestamp start_time = 7;
  120. // Output only. End of the Offer validity time.
  121. google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  122. // Parameters required to use current Offer to purchase.
  123. repeated ParameterDefinition parameter_definitions = 9;
  124. // The deal code of the offer to get a special promotion or discount.
  125. string deal_code = 12;
  126. }
  127. // Parameter's definition. Specifies what parameter is required to use the
  128. // current Offer to purchase.
  129. message ParameterDefinition {
  130. // Data type of the parameter.
  131. enum ParameterType {
  132. // Not used.
  133. PARAMETER_TYPE_UNSPECIFIED = 0;
  134. // Int64 type.
  135. INT64 = 1;
  136. // String type.
  137. STRING = 2;
  138. // Double type.
  139. DOUBLE = 3;
  140. }
  141. // Name of the parameter.
  142. string name = 1;
  143. // Data type of the parameter. Minimal value, Maximum value and allowed values
  144. // will use specified data type here.
  145. ParameterType parameter_type = 2;
  146. // Minimal value of the parameter, if applicable. Inclusive. For example,
  147. // minimal commitment when purchasing Anthos is 0.01.
  148. // Applicable to INT64 and DOUBLE parameter types.
  149. Value min_value = 3;
  150. // Maximum value of the parameter, if applicable. Inclusive. For example,
  151. // maximum seats when purchasing Google Workspace Business Standard.
  152. // Applicable to INT64 and DOUBLE parameter types.
  153. Value max_value = 4;
  154. // If not empty, parameter values must be drawn from this list.
  155. // For example, [us-west1, us-west2, ...]
  156. // Applicable to STRING parameter type.
  157. repeated Value allowed_values = 5;
  158. // If set to true, parameter is optional to purchase this Offer.
  159. bool optional = 6;
  160. }
  161. // Represents the constraints for buying the Offer.
  162. message Constraints {
  163. // Represents constraints required to purchase the Offer for a customer.
  164. CustomerConstraints customer_constraints = 1;
  165. }
  166. // Represents constraints required to purchase the Offer for a customer.
  167. message CustomerConstraints {
  168. // Allowed geographical regions of the customer.
  169. repeated string allowed_regions = 1;
  170. // Allowed Customer Type.
  171. repeated CloudIdentityInfo.CustomerType allowed_customer_types = 2;
  172. // Allowed Promotional Order Type. Present for Promotional offers.
  173. repeated PromotionalOrderType promotional_order_types = 3;
  174. }
  175. // The payment plan for the Offer. Describes how to make a payment.
  176. message Plan {
  177. // Describes how a reseller will be billed.
  178. PaymentPlan payment_plan = 1;
  179. // Specifies when the payment needs to happen.
  180. PaymentType payment_type = 2;
  181. // Describes how frequently the reseller will be billed, such as
  182. // once per month.
  183. Period payment_cycle = 3;
  184. // Present for Offers with a trial period.
  185. // For trial-only Offers, a paid service needs to start before the trial
  186. // period ends for continued service.
  187. // For Regular Offers with a trial period, the regular pricing goes into
  188. // effect when trial period ends, or if paid service is started before the end
  189. // of the trial period.
  190. Period trial_period = 4;
  191. // Reseller Billing account to charge after an offer transaction.
  192. // Only present for Google Cloud Platform offers.
  193. string billing_account = 5;
  194. }
  195. // Represents price by resource type.
  196. message PriceByResource {
  197. // Resource Type. Example: SEAT
  198. ResourceType resource_type = 1;
  199. // Price of the Offer. Present if there are no price phases.
  200. Price price = 2;
  201. // Specifies the price by time range.
  202. repeated PricePhase price_phases = 3;
  203. }
  204. // Represents the price of the Offer.
  205. message Price {
  206. // Base price.
  207. google.type.Money base_price = 1;
  208. // Discount percentage, represented as decimal.
  209. // For example, a 20% discount will be represent as 0.2.
  210. double discount = 2;
  211. // Effective Price after applying the discounts.
  212. google.type.Money effective_price = 3;
  213. // Link to external price list, such as link to Google Voice rate card.
  214. string external_price_uri = 4;
  215. }
  216. // Specifies the price by the duration of months.
  217. // For example, a 20% discount for the first six months, then a 10% discount
  218. // starting on the seventh month.
  219. message PricePhase {
  220. // Defines the phase period type.
  221. PeriodType period_type = 1;
  222. // Defines first period for the phase.
  223. int32 first_period = 2;
  224. // Defines first period for the phase.
  225. int32 last_period = 3;
  226. // Price of the phase. Present if there are no price tiers.
  227. Price price = 4;
  228. // Price by the resource tiers.
  229. repeated PriceTier price_tiers = 5;
  230. }
  231. // Defines price at resource tier level.
  232. // For example, an offer with following definition :
  233. //
  234. // * Tier 1: Provide 25% discount for all seats between 1 and 25.
  235. // * Tier 2: Provide 10% discount for all seats between 26 and 100.
  236. // * Tier 3: Provide flat 15% discount for all seats above 100.
  237. //
  238. // Each of these tiers is represented as a PriceTier.
  239. message PriceTier {
  240. // First resource for which the tier price applies.
  241. int32 first_resource = 1;
  242. // Last resource for which the tier price applies.
  243. int32 last_resource = 2;
  244. // Price of the tier.
  245. Price price = 3;
  246. }
  247. // Represents period in days/months/years.
  248. message Period {
  249. // Total duration of Period Type defined.
  250. int32 duration = 1;
  251. // Period Type.
  252. PeriodType period_type = 2;
  253. }