entitlements.proto 8.7 KB

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