Class: Google::Apis::PaymentsresellersubscriptionV1::Subscription
- Inherits:
-
Object
- Object
- Google::Apis::PaymentsresellersubscriptionV1::Subscription
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/paymentsresellersubscription_v1/classes.rb,
lib/google/apis/paymentsresellersubscription_v1/representations.rb,
lib/google/apis/paymentsresellersubscription_v1/representations.rb
Overview
Acts as a central billing entity between an external partner and Google. Google services use the subscription state to grant or revoke the user's service entitlement. Note: The subscription state might not perfectly align with the user's service entitlement. Some services might continue providing access until the current cycle ends, even if the subscription is immediately canceled. Consult the relevant contract or product policy for specific details.
Instance Attribute Summary collapse
-
#cancellation_details ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionCancellationDetails
Describes the details of a cancelled or cancelling subscription.
-
#create_time ⇒ String
Output only.
-
#cycle_end_time ⇒ String
Output only.
-
#end_user_entitled ⇒ Boolean
(also: #end_user_entitled?)
Output only.
-
#free_trial_end_time ⇒ String
Output only.
-
#line_items ⇒ Array<Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem>
Required.
-
#migration_details ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionMigrationDetails
Describes the details of the migrated subscription.
-
#name ⇒ String
Identifier.
-
#partner_user_token ⇒ String
Required.
-
#processing_state ⇒ String
Output only.
-
#products ⇒ Array<String>
Optional.
-
#promotion_specs ⇒ Array<Google::Apis::PaymentsresellersubscriptionV1::SubscriptionPromotionSpec>
Optional.
-
#promotions ⇒ Array<String>
Optional.
-
#purchase_time ⇒ String
Optional.
-
#redirect_uri ⇒ String
Output only.
-
#renewal_time ⇒ String
Output only.
-
#service_location ⇒ Google::Apis::PaymentsresellersubscriptionV1::Location
Describes a location of an end user.
-
#state ⇒ String
Output only.
-
#update_time ⇒ String
Output only.
-
#upgrade_downgrade_details ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionUpgradeDowngradeDetails
Details about the previous subscription that this new subscription upgrades/ downgrades from.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Subscription
constructor
A new instance of Subscription.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Subscription
Returns a new instance of Subscription.
1260 1261 1262 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1260 def initialize(**args) update!(**args) end |
Instance Attribute Details
#cancellation_details ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionCancellationDetails
Describes the details of a cancelled or cancelling subscription.
Corresponds to the JSON property cancellationDetails
1132 1133 1134 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1132 def cancellation_details @cancellation_details end |
#create_time ⇒ String
Output only. System generated timestamp when the subscription is created. UTC
timezone.
Corresponds to the JSON property createTime
1138 1139 1140 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1138 def create_time @create_time end |
#cycle_end_time ⇒ String
Output only. The time at which the subscription is expected to be extended, in
ISO 8061 format. UTC timezone. For example: "2019-08-31T17:28:54.564Z"
Corresponds to the JSON property cycleEndTime
1144 1145 1146 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1144 def cycle_end_time @cycle_end_time end |
#end_user_entitled ⇒ Boolean Also known as: end_user_entitled?
Output only. Indicates if the subscription is entitled to the end user.
Corresponds to the JSON property endUserEntitled
1149 1150 1151 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1149 def end_user_entitled @end_user_entitled end |
#free_trial_end_time ⇒ String
Output only. End of the free trial period, in ISO 8061 format. For example, "
2019-08-31T17:28:54.564Z". It will be set the same as createTime if no free
trial promotion is specified.
Corresponds to the JSON property freeTrialEndTime
1157 1158 1159 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1157 def free_trial_end_time @free_trial_end_time end |
#line_items ⇒ Array<Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem>
Required. The line items of the subscription.
Corresponds to the JSON property lineItems
1162 1163 1164 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1162 def line_items @line_items end |
#migration_details ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionMigrationDetails
Describes the details of the migrated subscription.
Corresponds to the JSON property migrationDetails
1167 1168 1169 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1167 def migration_details @migration_details end |
#name ⇒ String
Identifier. Resource name of the subscription. It will have the format of "
partners/partner_id/subscriptions/subscription_id". This is available for
authorizeAddon, but otherwise is response only.
Corresponds to the JSON property name
1174 1175 1176 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1174 def name @name end |
#partner_user_token ⇒ String
Required. Identifier of the end-user in partner’s system. The value is
restricted to 63 ASCII characters at the maximum.
Corresponds to the JSON property partnerUserToken
1180 1181 1182 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1180 def partner_user_token @partner_user_token end |
#processing_state ⇒ String
Output only. Describes the processing state of the subscription. See more
details at the lifecycle of a subscription.
Corresponds to the JSON property processingState
1187 1188 1189 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1187 def processing_state @processing_state end |
#products ⇒ Array<String>
Optional. Deprecated: consider using line_items as the input. Required.
Resource name that identifies the purchased products. The format will be '
partners/partner_id/products/product_id'.
Corresponds to the JSON property products
1194 1195 1196 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1194 def products @products end |
#promotion_specs ⇒ Array<Google::Apis::PaymentsresellersubscriptionV1::SubscriptionPromotionSpec>
Optional. Subscription-level promotions. Only free trial is supported on this
level. It determines the first renewal time of the subscription to be the end
of the free trial period. Specify the promotion resource name only when used
as input.
Corresponds to the JSON property promotionSpecs
1202 1203 1204 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1202 def promotion_specs @promotion_specs end |
#promotions ⇒ Array<String>
Optional. Deprecated: consider using the top-level promotion_specs as the
input. Optional. Resource name that identifies one or more promotions that can
be applied on the product. A typical promotion for a subscription is Free
trial. The format will be 'partners/partner_id/promotions/promotion_id'.
Corresponds to the JSON property promotions
1210 1211 1212 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1210 def promotions @promotions end |
#purchase_time ⇒ String
Optional. The timestamp when the user transaction was made with the Partner.
Specify for the case of "bundle with choice", and it must be before the
provision_time (when the user makes a selection).
Corresponds to the JSON property purchaseTime
1217 1218 1219 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1217 def purchase_time @purchase_time end |
#redirect_uri ⇒ String
Output only. The place where partners should redirect the end-user to after
creation. This field might also be populated when creation failed. However,
Partners should always prepare a default URL to redirect the user in case this
field is empty.
Corresponds to the JSON property redirectUri
1225 1226 1227 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1225 def redirect_uri @redirect_uri end |
#renewal_time ⇒ String
Output only. The time at which the subscription is expected to be renewed by
Google - a new charge will be incurred and the service entitlement will be
renewed. A non-immediate cancellation will take place at this time too, before
which, the service entitlement for the end user will remain valid. UTC
timezone in ISO 8061 format. For example: "2019-08-31T17:28:54.564Z"
Corresponds to the JSON property renewalTime
1234 1235 1236 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1234 def renewal_time @renewal_time end |
#service_location ⇒ Google::Apis::PaymentsresellersubscriptionV1::Location
Describes a location of an end user.
Corresponds to the JSON property serviceLocation
1239 1240 1241 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1239 def service_location @service_location end |
#state ⇒ String
Output only. Describes the state of the subscription. See more details at the
lifecycle of a subscription.
Corresponds to the JSON property state
1246 1247 1248 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1246 def state @state end |
#update_time ⇒ String
Output only. System generated timestamp when the subscription is most recently
updated. UTC timezone.
Corresponds to the JSON property updateTime
1252 1253 1254 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1252 def update_time @update_time end |
#upgrade_downgrade_details ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionUpgradeDowngradeDetails
Details about the previous subscription that this new subscription upgrades/
downgrades from.
Corresponds to the JSON property upgradeDowngradeDetails
1258 1259 1260 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1258 def upgrade_downgrade_details @upgrade_downgrade_details end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 |
# File 'lib/google/apis/paymentsresellersubscription_v1/classes.rb', line 1265 def update!(**args) @cancellation_details = args[:cancellation_details] if args.key?(:cancellation_details) @create_time = args[:create_time] if args.key?(:create_time) @cycle_end_time = args[:cycle_end_time] if args.key?(:cycle_end_time) @end_user_entitled = args[:end_user_entitled] if args.key?(:end_user_entitled) @free_trial_end_time = args[:free_trial_end_time] if args.key?(:free_trial_end_time) @line_items = args[:line_items] if args.key?(:line_items) @migration_details = args[:migration_details] if args.key?(:migration_details) @name = args[:name] if args.key?(:name) @partner_user_token = args[:partner_user_token] if args.key?(:partner_user_token) @processing_state = args[:processing_state] if args.key?(:processing_state) @products = args[:products] if args.key?(:products) @promotion_specs = args[:promotion_specs] if args.key?(:promotion_specs) @promotions = args[:promotions] if args.key?(:promotions) @purchase_time = args[:purchase_time] if args.key?(:purchase_time) @redirect_uri = args[:redirect_uri] if args.key?(:redirect_uri) @renewal_time = args[:renewal_time] if args.key?(:renewal_time) @service_location = args[:service_location] if args.key?(:service_location) @state = args[:state] if args.key?(:state) @update_time = args[:update_time] if args.key?(:update_time) @upgrade_downgrade_details = args[:upgrade_downgrade_details] if args.key?(:upgrade_downgrade_details) end |