entitlements
Creates, updates, deletes, gets or lists a entitlements
resource.
Overview
Name | entitlements |
Type | Resource |
Id | google.cloudcommerceprocurement.entitlements |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the entitlement. Entitlement names have the form providers/{provider_id}/entitlements/{entitlement_id} . |
account | string | Output only. The resource name of the account that this entitlement is based on, if any. |
cancellationReason | string | Output only. The reason the entitlement was cancelled. If this entitlement wasn't cancelled, this field is empty. Possible values include "unknown", "expired", "user-cancelled", "account-closed", "billing-disabled" (if the customer has manually disabled billing to their resources), "user-aborted", and "migrated" (if the entitlement has migrated across products). Values of this field are subject to change, and we recommend that you don't build your technical integration to rely on these fields. |
consumers | array | Output only. The resources using this entitlement, if applicable. |
createTime | string | Output only. The creation timestamp. |
entitlementBenefitIds | array | Output only. The entitlement benefit IDs associated with the purchase. |
inputProperties | object | Output only. The custom properties that were collected from the user to create this entitlement. |
messageToUser | string | Provider-supplied message that is displayed to the end user. Currently this is used to communicate progress and ETA for provisioning. This field can be updated only when a user is waiting for an action from the provider, i.e. entitlement state is EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED or EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL. This field is cleared automatically when the entitlement state changes. |
newOfferEndTime | string | Output only. The end time of the new offer. If the offer was created with a term instead of a specified end date, this field is empty. This field is populated even if the entitlement isn't active yet. If there's no upcoming offer, the field is be empty. |
newOfferStartTime | string | Output only. The timestamp when the new offer becomes effective. This field is populated even if the entitlement isn't active yet. If there's no upcoming offer, the field is empty. |
newPendingOffer | string | Output only. The name of the offer the entitlement is switching to upon a pending plan change. Only exists if the pending plan change is moving to an offer. This field isn't populated for entitlements which aren't active yet. Format: 'projects/{project}/services/{service}/privateOffers/{offer-id}' OR 'projects/{project}/services/{service}/standardOffers/{offer-id}', depending on whether the offer is private or public. The {service} in the name is the listing service of the offer. It could be either the product service that the offer is referencing, or a generic private offer parent service. We recommend that you don't build your integration to rely on the meaning of this {service} part. |
newPendingOfferDuration | string | Output only. The duration of the new offer, in ISO 8601 duration format. This field isn't populated for entitlements which aren't active yet, only for pending offer changes. If the offer was created with a specified end date instead of a duration, this field is empty. |
newPendingPlan | string | Output only. The identifier of the pending new plan. Required if the product has plans and the entitlement has a pending plan change. |
offer | string | Output only. The name of the offer that was procured. Field is empty if order was not made using an offer. Format: 'projects/{project}/services/{service}/privateOffers/{offer-id}' OR 'projects/{project}/services/{service}/standardOffers/{offer-id}', depending on whether the offer is private or public. The {service} in the name is the listing service of the offer. It could be either the product service that the offer is referencing, or a generic private offer parent service. We recommend that you don't build your integration to rely on the meaning of this {service} part. |
offerDuration | string | Output only. The offer duration of the current offer in ISO 8601 duration format. Field is empty if entitlement was not made using an offer. If the offer was created with a specified end date instead of a duration, this field is empty. |
offerEndTime | string | Output only. End time for the Offer association corresponding to this entitlement. The field is only populated if the entitlement is currently associated with an Offer. |
orderId | string | Output only. The order ID of this entitlement, without any orders/ resource name prefix. |
plan | string | Output only. The identifier of the plan that was procured. Required if the product has plans. |
product | string | Output only. The identifier of the entity that was purchased. This may actually represent a product, quote, or offer. We strongly recommend that you use the following more explicit fields: productExternalName, quoteExternalName, or offer. |
productExternalName | string | Output only. The identifier of the product that was procured. |
provider | string | Output only. The identifier of the service provider that this entitlement was created against. Each service provider is assigned a unique provider value when they onboard with Cloud Commerce platform. |
quoteExternalName | string | Output only. The identifier of the quote that was used to procure. Empty if the order is not purchased using a quote. |
state | string | Output only. The state of the entitlement. |
subscriptionEndTime | string | Output only. End time for the subscription corresponding to this entitlement. |
updateTime | string | Output only. The last update timestamp. |
usageReportingId | string | Output only. The consumerId to use when reporting usage through the Service Control API. See the consumerId field at Reporting Metrics for more details. This field is present only if the product has usage-based billing configured. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | entitlementsId, providersId | Gets a requested Entitlement resource. |
list | SELECT | providersId | Lists Entitlements for which the provider has read access. |
patch | UPDATE | entitlementsId, providersId | Updates an existing Entitlement. |
approve | EXEC | entitlementsId, providersId | Approves an entitlement that is in the EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is invoked by the provider to approve the creation of the entitlement resource. |
approve_plan_change | EXEC | entitlementsId, providersId | Approves an entitlement plan change that is in the EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method is invoked by the provider to approve the plan change on the entitlement resource. |
reject | EXEC | entitlementsId, providersId | Rejects an entitlement that is in the EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is invoked by the provider to reject the creation of the entitlement resource. |
reject_plan_change | EXEC | entitlementsId, providersId | Rejects an entitlement plan change that is in the EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method is invoked by the provider to reject the plan change on the entitlement resource. |
suspend | EXEC | entitlementsId, providersId | Requests suspension of an active Entitlement. This is not yet supported. |
SELECT
examples
Lists Entitlements for which the provider has read access.
SELECT
name,
account,
cancellationReason,
consumers,
createTime,
entitlementBenefitIds,
inputProperties,
messageToUser,
newOfferEndTime,
newOfferStartTime,
newPendingOffer,
newPendingOfferDuration,
newPendingPlan,
offer,
offerDuration,
offerEndTime,
orderId,
plan,
product,
productExternalName,
provider,
quoteExternalName,
state,
subscriptionEndTime,
updateTime,
usageReportingId
FROM google.cloudcommerceprocurement.entitlements
WHERE providersId = '{{ providersId }}';
UPDATE
example
Updates a entitlements
resource.
/*+ update */
UPDATE google.cloudcommerceprocurement.entitlements
SET
provider = '{{ provider }}',
newPendingPlan = '{{ newPendingPlan }}',
consumers = '{{ consumers }}',
name = '{{ name }}',
state = '{{ state }}',
usageReportingId = '{{ usageReportingId }}',
product = '{{ product }}',
inputProperties = '{{ inputProperties }}',
account = '{{ account }}',
messageToUser = '{{ messageToUser }}',
plan = '{{ plan }}'
WHERE
entitlementsId = '{{ entitlementsId }}'
AND providersId = '{{ providersId }}';