offers.proto 9.0 KB

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