Class: Google::Apis::CloudcommerceprocurementV1::Entitlement

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudcommerceprocurement_v1/classes.rb,
lib/google/apis/cloudcommerceprocurement_v1/representations.rb,
lib/google/apis/cloudcommerceprocurement_v1/representations.rb

Overview

Represents a procured product of a customer.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Entitlement

Returns a new instance of Entitlement.



511
512
513
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 511

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#accountString

Output only. The resource name of the account that this entitlement is based on, if any. Corresponds to the JSON property account

Returns:

  • (String)


261
262
263
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 261

def 
  @account
end

#cancellation_reasonString

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. Corresponds to the JSON property cancellationReason

Returns:

  • (String)


272
273
274
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 272

def cancellation_reason
  @cancellation_reason
end

#consumersArray<Google::Apis::CloudcommerceprocurementV1::Consumer>

Output only. The resources using this entitlement, if applicable. Corresponds to the JSON property consumers



277
278
279
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 277

def consumers
  @consumers
end

#create_timeString

Output only. The creation timestamp. Corresponds to the JSON property createTime

Returns:

  • (String)


282
283
284
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 282

def create_time
  @create_time
end

#entitlement_benefit_idsArray<String>

Output only. The entitlement benefit IDs associated with the purchase. Corresponds to the JSON property entitlementBenefitIds

Returns:

  • (Array<String>)


287
288
289
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 287

def entitlement_benefit_ids
  @entitlement_benefit_ids
end

#input_propertiesHash<String,Object>

Output only. The custom properties that were collected from the user to create this entitlement. Corresponds to the JSON property inputProperties

Returns:

  • (Hash<String,Object>)


293
294
295
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 293

def input_properties
  @input_properties
end

#message_to_userString

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. Corresponds to the JSON property messageToUser

Returns:

  • (String)


303
304
305
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 303

def message_to_user
  @message_to_user
end

#nameString

Output only. The resource name of the entitlement. Entitlement names have the form providers/provider_id/entitlements/entitlement_id`. Corresponds to the JSON propertyname`

Returns:

  • (String)


309
310
311
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 309

def name
  @name
end

#new_offer_end_timeString

Output only. The end time of the new offer, determined from the offer's specified end date. If the offer des not have a specified end date then this field is not set. This field is populated even if the entitlement isn't active yet. If there's no upcoming offer, the field is empty. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, ENTITLEMENT_ACTIVE, or ENTITLEMENT_PENDING_CANCELLATION, then this field is empty. * If the entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or ENTITLEMENT_PENDING_PLAN_CHANGE, and the upcoming offer has a specified end date, then this field is populated with the expected end time of the upcoming offer, in the future. Otherwise, this field is empty. * If the entitlement is in the state ENTITLEMENT_CANCELLED, then this field is empty. Corresponds to the JSON property newOfferEndTime

Returns:

  • (String)


324
325
326
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 324

def new_offer_end_time
  @new_offer_end_time
end

#new_offer_start_timeString

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. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, this field isn't populated when the entitlement isn't yet approved. After the entitlement is approved, this field is populated with the effective time of the upcoming offer. * If the entitlement is in the state ENTITLEMENT_ACTIVE or ENTITLEMENT_PENDING_CANCELLATION, this field isn't populated. * If the entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL, this field isn't populated, because the entitlement change is waiting on approval. * If the entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE, this field is populated with the expected effective time of the upcoming offer, which is in the future. * If the entitlement is in the state ENTITLEMENT_CANCELLED, then this field is empty. Corresponds to the JSON property newOfferStartTime

Returns:

  • (String)


342
343
344
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 342

def new_offer_start_time
  @new_offer_start_time
end

#new_pending_offerString

Output only. Upon a pending plan change, the name of the offer that the entitlement is switching to. 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' OR ' projects/project/services/service/standardOffers/offer', 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. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, ENTITLEMENT_ACTIVE or ENTITLEMENT_PENDING_CANCELLATION, then this field is empty. * If the entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or ENTITLEMENT_PENDING_PLAN_CHANGE, then this field is populated with the upcoming offer. * If the entitlement is in the state ENTITLEMENT_CANCELLED, then this is empty. Corresponds to the JSON property newPendingOffer

Returns:

  • (String)


361
362
363
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 361

def new_pending_offer
  @new_pending_offer
end

#new_pending_offer_durationString

Output only. The duration of the new offer, in ISO 8601 duration format. This field is populated for pending offer changes. It isn't populated for entitlements which aren't active yet. If the offer has a specified end date instead of a duration, this field is empty. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, ENTITLEMENT_ACTIVE, or ENTITLEMENT_PENDING_CANCELLATION, this field is empty. * If the entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or ENTITLEMENT_PENDING_PLAN_CHANGE, and the upcoming offer doesn't have a specified end date, then this field is populated with the duration of the upcoming offer. Otherwise, this field is empty. * If the entitlement is in the state ENTITLEMENT_CANCELLED, then this field is empty. Corresponds to the JSON property newPendingOfferDuration

Returns:

  • (String)


376
377
378
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 376

def new_pending_offer_duration
  @new_pending_offer_duration
end

#new_pending_planString

Output only. The identifier of the pending new plan. Required if the product has plans and the entitlement has a pending plan change. Corresponds to the JSON property newPendingPlan

Returns:

  • (String)


382
383
384
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 382

def new_pending_plan
  @new_pending_plan
end

#offerString

Output only. The name of the offer that was procured. Field is empty if order wasn't made using an offer. Format: 'projects/project/services/service/ privateOffers/offer' OR 'projects/project/services/service/ standardOffers/offer', 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. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, this field is populated with the upcoming offer. * If the entitlement is in the state ENTITLEMENT_ACTIVE, ENTITLEMENT_PENDING_CANCELLATION, ENTITLEMENT_PENDING_PLAN_CHANGE, or ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL, this field is populated with the current offer. * If the entitlement is in the state ENTITLEMENT_CANCELLED, then this field is populated with the latest offer that the order was associated with. Corresponds to the JSON property offer

Returns:

  • (String)


401
402
403
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 401

def offer
  @offer
end

#offer_durationString

Output only. The offer duration of the current offer, in ISO 8601 duration format. This is empty if the entitlement wasn't made using an offer, or if the offer has a specified end date instead of a duration. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, and the upcoming offer doesn't have a specified end date, then this field is populated with the duration of the upcoming offer. Otherwise, this field is empty. * If the entitlement is in the state ENTITLEMENT_ACTIVE, ENTITLEMENT_PENDING_CANCELLATION, ENTITLEMENT_PENDING_PLAN_CHANGE, or ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL, and the current offer doesn't have a specified end date, then this field contains the duration of the current offer. Otherwise, this field is empty. * If the entitlement is in the state ENTITLEMENT_CANCELLED, and the offer doesn' t have a specified end date, then this field is populated with the duration of the latest offer that the order was associated with. Otherwise, this field is empty. Corresponds to the JSON property offerDuration

Returns:

  • (String)


419
420
421
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 419

def offer_duration
  @offer_duration
end

#offer_end_timeString

Output only. End time for the current term of the Offer associated with this entitlement. The value of this field can change naturally over time due to auto-renewal, even if the offer isn't changed. * If the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, then: * If the entitlement isn't approved yet approved, and the offer has a specified end date, then this field is populated with the expected end time of the upcoming offer, in the future. Otherwise, this field is empty. * If the entitlement is approved, then this field is populated with the expected end time of the upcoming offer, in the future. This means that this field and the field offer_duration can both exist.

  • If the entitlement is in the state ENTITLEMENT_ACTIVE or ENTITLEMENT_PENDING_CANCELLATION, then this field is populated with the expected end time of the current offer, in the future. This field's value is set regardless of whether the offer has a specific end date or a duration. This means that this field and the field offer_duration can both exist. * If the entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or ENTITLEMENT_PENDING_PLAN_CHANGE: * If the entitlement's pricing model is usage based and the associated offer is a private offer whose term has ended, then this field reflects the ACTUAL end time of the entitlement's associated offer ( in the past), even though the entitlement associated with this private offer does not terminate at the end of that private offer's term. * Otherwise, this is the expected end date of the current offer, in the future. * If the entitlement is in the state ENTITLEMENT_CANCELLED, then this field is populated with the end time, in the past, of the latest offer that the order was associated with. If the entitlement was cancelled before any offer started, then this field is empty. Corresponds to the JSON property offerEndTime

Returns:

  • (String)


448
449
450
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 448

def offer_end_time
  @offer_end_time
end

#order_idString

Output only. The order ID of this entitlement, without any orders/ resource name prefix. Corresponds to the JSON property orderId

Returns:

  • (String)


454
455
456
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 454

def order_id
  @order_id
end

#planString

Output only. The identifier of the plan that was procured. Required if the product has plans. Corresponds to the JSON property plan

Returns:

  • (String)


460
461
462
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 460

def plan
  @plan
end

#productString

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. Corresponds to the JSON property product

Returns:

  • (String)


468
469
470
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 468

def product
  @product
end

#product_external_nameString

Output only. The identifier of the product that was procured. Corresponds to the JSON property productExternalName

Returns:

  • (String)


473
474
475
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 473

def product_external_name
  @product_external_name
end

#providerString

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. Corresponds to the JSON property provider

Returns:

  • (String)


480
481
482
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 480

def provider
  @provider
end

#quote_external_nameString

Output only. The identifier of the quote that was used to procure. Empty if the order is not purchased using a quote. Corresponds to the JSON property quoteExternalName

Returns:

  • (String)


486
487
488
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 486

def quote_external_name
  @quote_external_name
end

#stateString

Output only. The state of the entitlement. Corresponds to the JSON property state

Returns:

  • (String)


491
492
493
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 491

def state
  @state
end

#subscription_end_timeString

Output only. End time for the subscription corresponding to this entitlement. Corresponds to the JSON property subscriptionEndTime

Returns:

  • (String)


496
497
498
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 496

def subscription_end_time
  @subscription_end_time
end

#update_timeString

Output only. The last update timestamp. Corresponds to the JSON property updateTime

Returns:

  • (String)


501
502
503
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 501

def update_time
  @update_time
end

#usage_reporting_idString

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. Corresponds to the JSON property usageReportingId

Returns:

  • (String)


509
510
511
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 509

def usage_reporting_id
  @usage_reporting_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/google/apis/cloudcommerceprocurement_v1/classes.rb', line 516

def update!(**args)
  @account = args[:account] if args.key?(:account)
  @cancellation_reason = args[:cancellation_reason] if args.key?(:cancellation_reason)
  @consumers = args[:consumers] if args.key?(:consumers)
  @create_time = args[:create_time] if args.key?(:create_time)
  @entitlement_benefit_ids = args[:entitlement_benefit_ids] if args.key?(:entitlement_benefit_ids)
  @input_properties = args[:input_properties] if args.key?(:input_properties)
  @message_to_user = args[:message_to_user] if args.key?(:message_to_user)
  @name = args[:name] if args.key?(:name)
  @new_offer_end_time = args[:new_offer_end_time] if args.key?(:new_offer_end_time)
  @new_offer_start_time = args[:new_offer_start_time] if args.key?(:new_offer_start_time)
  @new_pending_offer = args[:new_pending_offer] if args.key?(:new_pending_offer)
  @new_pending_offer_duration = args[:new_pending_offer_duration] if args.key?(:new_pending_offer_duration)
  @new_pending_plan = args[:new_pending_plan] if args.key?(:new_pending_plan)
  @offer = args[:offer] if args.key?(:offer)
  @offer_duration = args[:offer_duration] if args.key?(:offer_duration)
  @offer_end_time = args[:offer_end_time] if args.key?(:offer_end_time)
  @order_id = args[:order_id] if args.key?(:order_id)
  @plan = args[:plan] if args.key?(:plan)
  @product = args[:product] if args.key?(:product)
  @product_external_name = args[:product_external_name] if args.key?(:product_external_name)
  @provider = args[:provider] if args.key?(:provider)
  @quote_external_name = args[:quote_external_name] if args.key?(:quote_external_name)
  @state = args[:state] if args.key?(:state)
  @subscription_end_time = args[:subscription_end_time] if args.key?(:subscription_end_time)
  @update_time = args[:update_time] if args.key?(:update_time)
  @usage_reporting_id = args[:usage_reporting_id] if args.key?(:usage_reporting_id)
end