entitlements.proto 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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/offers.proto";
  20. import "google/cloud/channel/v1/products.proto";
  21. import "google/protobuf/timestamp.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 = "EntitlementsProto";
  25. option java_package = "com.google.cloud.channel.v1";
  26. // An entitlement is a representation of a customer's ability to use a service.
  27. message Entitlement {
  28. option (google.api.resource) = {
  29. type: "cloudchannel.googleapis.com/Entitlement"
  30. pattern: "accounts/{account}/customers/{customer}/entitlements/{entitlement}"
  31. };
  32. // Indicates the current provisioning state of the entitlement.
  33. enum ProvisioningState {
  34. // Not used.
  35. PROVISIONING_STATE_UNSPECIFIED = 0;
  36. // The entitlement is currently active.
  37. ACTIVE = 1;
  38. // The entitlement is currently suspended.
  39. SUSPENDED = 5;
  40. }
  41. // Suspension reason for an entitlement if [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] = SUSPENDED.
  42. enum SuspensionReason {
  43. // Not used.
  44. SUSPENSION_REASON_UNSPECIFIED = 0;
  45. // Entitlement was manually suspended by the Reseller.
  46. RESELLER_INITIATED = 1;
  47. // Trial ended.
  48. TRIAL_ENDED = 2;
  49. // Entitlement renewal was canceled.
  50. RENEWAL_WITH_TYPE_CANCEL = 3;
  51. // Entitlement was automatically suspended on creation for pending ToS
  52. // acceptance on customer.
  53. PENDING_TOS_ACCEPTANCE = 4;
  54. // Other reasons (internal reasons, abuse, etc.).
  55. OTHER = 100;
  56. }
  57. // Output only. Resource name of an entitlement in the form:
  58. // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}.
  59. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  60. // Output only. The time at which the entitlement is created.
  61. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  62. // Output only. The time at which the entitlement is updated.
  63. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  64. // Required. The offer resource name for which the entitlement is to be
  65. // created. Takes the form: accounts/{account_id}/offers/{offer_id}.
  66. string offer = 8 [
  67. (google.api.field_behavior) = REQUIRED,
  68. (google.api.resource_reference) = {
  69. type: "cloudchannel.googleapis.com/Offer"
  70. }
  71. ];
  72. // Commitment settings for a commitment-based Offer.
  73. // Required for commitment based offers.
  74. CommitmentSettings commitment_settings = 12;
  75. // Output only. Current provisioning state of the entitlement.
  76. ProvisioningState provisioning_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  77. // Output only. Service provisioning details for the entitlement.
  78. ProvisionedService provisioned_service = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  79. // Output only. Enumerable of all current suspension reasons for an entitlement.
  80. repeated SuspensionReason suspension_reasons = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  81. // Optional. This purchase order (PO) information is for resellers to use for their
  82. // company tracking usage. If a purchaseOrderId value is given, it appears in
  83. // the API responses and shows up in the invoice. The property accepts up to
  84. // 80 plain text characters. This is only supported for Google Workspace
  85. // entitlements.
  86. string purchase_order_id = 19 [(google.api.field_behavior) = OPTIONAL];
  87. // Output only. Settings for trial offers.
  88. TrialSettings trial_settings = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
  89. // Association information to other entitlements.
  90. AssociationInfo association_info = 23;
  91. // Extended entitlement parameters. When creating an entitlement, valid
  92. // parameter names and values are defined in the
  93. // [Offer.parameter_definitions][google.cloud.channel.v1.Offer.parameter_definitions].
  94. //
  95. // The response may include the following output-only Parameters:
  96. //
  97. // - assigned_units: The number of licenses assigned to users.
  98. //
  99. // - max_units: The maximum assignable units for a flexible offer.
  100. //
  101. // - num_units: The total commitment for commitment-based offers.
  102. repeated Parameter parameters = 26;
  103. }
  104. // Definition for extended entitlement parameters.
  105. message Parameter {
  106. // Name of the parameter.
  107. string name = 1;
  108. // Value of the parameter.
  109. Value value = 2;
  110. // Output only. Specifies whether this parameter is allowed to be changed. For example, for
  111. // a Google Workspace Business Starter entitlement in commitment plan,
  112. // num_units is editable when entitlement is active.
  113. bool editable = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  114. }
  115. // Association links that an entitlement has to other entitlements.
  116. message AssociationInfo {
  117. // The name of the base entitlement, for which this entitlement is an add-on.
  118. string base_entitlement = 1 [(google.api.resource_reference) = {
  119. type: "cloudchannel.googleapis.com/Entitlement"
  120. }];
  121. }
  122. // Service provisioned for an entitlement.
  123. message ProvisionedService {
  124. // Output only. Provisioning ID of the entitlement. For Google Workspace, this is the
  125. // underlying Subscription ID. For Google Cloud Platform, this is the
  126. // Billing Account ID of the billing subaccount."
  127. string provisioning_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  128. // Output only. The product pertaining to the provisioning resource as specified in the
  129. // Offer.
  130. string product_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  131. // Output only. The SKU pertaining to the provisioning resource as specified in the Offer.
  132. string sku_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  133. }
  134. // Commitment settings for commitment-based offers.
  135. message CommitmentSettings {
  136. // Output only. Commitment start timestamp.
  137. google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  138. // Output only. Commitment end timestamp.
  139. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  140. // Optional. Renewal settings applicable for a commitment-based Offer.
  141. RenewalSettings renewal_settings = 4 [(google.api.field_behavior) = OPTIONAL];
  142. }
  143. // Renewal settings for renewable Offers.
  144. message RenewalSettings {
  145. // If false, the plan will be completed at the end date.
  146. bool enable_renewal = 1;
  147. // If true and enable_renewal = true, the unit (for example seats or licenses)
  148. // will be set to the number of active units at renewal time.
  149. bool resize_unit_count = 2;
  150. // Describes how a reseller will be billed.
  151. PaymentPlan payment_plan = 5;
  152. // Describes how frequently the reseller will be billed, such as
  153. // once per month.
  154. Period payment_cycle = 6;
  155. }
  156. // Settings for trial offers.
  157. message TrialSettings {
  158. // Determines if the entitlement is in a trial or not:
  159. //
  160. // * `true` - The entitlement is in trial.
  161. // * `false` - The entitlement is not in trial.
  162. bool trial = 1;
  163. // Date when the trial ends. The value is in milliseconds
  164. // using the UNIX Epoch format. See an example [Epoch
  165. // converter](https://www.epochconverter.com).
  166. google.protobuf.Timestamp end_time = 2;
  167. }
  168. // TransferableSku represents information a reseller needs to view existing
  169. // provisioned services for a customer that they do not own.
  170. // Read-only.
  171. message TransferableSku {
  172. // Describes the transfer eligibility of a SKU.
  173. TransferEligibility transfer_eligibility = 9;
  174. // The SKU pertaining to the provisioning resource as specified in the Offer.
  175. Sku sku = 11;
  176. // Optional. The customer to transfer has an entitlement with the populated legacy SKU.
  177. Sku legacy_sku = 12 [(google.api.field_behavior) = OPTIONAL];
  178. }
  179. // Specifies transfer eligibility of a SKU.
  180. message TransferEligibility {
  181. // Reason of ineligibility.
  182. enum Reason {
  183. // Not used.
  184. REASON_UNSPECIFIED = 0;
  185. // Reseller needs to accept TOS before transferring the SKU.
  186. PENDING_TOS_ACCEPTANCE = 1;
  187. // Reseller not eligible to sell the SKU.
  188. SKU_NOT_ELIGIBLE = 2;
  189. // SKU subscription is suspended
  190. SKU_SUSPENDED = 3;
  191. }
  192. // Whether reseller is eligible to transfer the SKU.
  193. bool is_eligible = 1;
  194. // Localized description if reseller is not eligible to transfer the SKU.
  195. string description = 2;
  196. // Specified the reason for ineligibility.
  197. Reason ineligibility_reason = 3;
  198. }