Class: Google::Apis::PaymentsresellersubscriptionV1::PaymentsResellerSubscriptionService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PaymentsresellersubscriptionV1::PaymentsResellerSubscriptionService
- Defined in:
- lib/google/apis/paymentsresellersubscription_v1/service.rb
Overview
Payments Reseller Subscription API
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://paymentsresellersubscription.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#cancel_partner_subscription(name, cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::CancelSubscriptionResponse
Cancels a subscription service either immediately or by the end of the current billing cycle for their customers.
-
#create_partner_subscription(parent, subscription_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::Subscription
Used by partners to create a subscription for their customers.
-
#entitle_partner_subscription(name, entitle_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::EntitleSubscriptionResponse
Entitles a previously provisioned subscription to the current end user.
-
#extend_partner_subscription(name, extend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ExtendSubscriptionResponse
[Opt-in only] Most partners should be on auto-extend by default.
-
#find_partner_promotion_eligible(parent, find_eligible_promotions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::FindEligiblePromotionsResponse
Currently, it is only enabeld for YouTube.
-
#generate_partner_user_session(parent, generate_user_session_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::GenerateUserSessionResponse
This API replaces user authorized OAuth consent based APIs (Create, Entitle).
-
#get_partner_subscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::Subscription
Gets a subscription by id.
-
#initialize ⇒ PaymentsResellerSubscriptionService
constructor
A new instance of PaymentsResellerSubscriptionService.
-
#list_partner_products(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ListProductsResponse
Currently, it doesn't support YouTube products.
-
#list_partner_promotions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ListPromotionsResponse
Currently, it doesn't support YouTube promotions.
-
#patch_partner_subscription_line_item(name, subscription_line_item_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem
Updates a line item of a subscription.
-
#provision_partner_subscription(parent, subscription_object = nil, cycle_options_initial_cycle_duration_count: nil, cycle_options_initial_cycle_duration_unit: nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::Subscription
Used by partners to provision a subscription for their customers.
-
#resume_partner_subscription(name, resume_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ResumeSubscriptionResponse
Resumes a suspended subscription.
-
#suspend_partner_subscription(name, suspend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::SuspendSubscriptionResponse
Suspends a subscription.
-
#undo_partner_subscription_cancel(name, undo_cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::UndoCancelSubscriptionResponse
Currently, it is used by Google One, Play Pass partners.
Constructor Details
#initialize ⇒ PaymentsResellerSubscriptionService
Returns a new instance of PaymentsResellerSubscriptionService.
47 48 49 50 51 52 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-paymentsresellersubscription_v1', client_version: Google::Apis::PaymentsresellersubscriptionV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#cancel_partner_subscription(name, cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::CancelSubscriptionResponse
Cancels a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 221 def cancel_partner_subscription(name, cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:cancel', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::CancelSubscriptionRequest::Representation command.request_object = cancel_subscription_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::CancelSubscriptionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::CancelSubscriptionResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_partner_subscription(parent, subscription_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::Subscription
Used by partners to create a subscription for their customers. The created subscription is associated with the end user inferred from the end user credentials. This API must be authorized by the end user using OAuth.
262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 262 def create_partner_subscription(parent, subscription_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/subscriptions', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::Subscription::Representation command.request_object = subscription_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::Subscription::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::Subscription command.params['parent'] = parent unless parent.nil? command.query['subscriptionId'] = subscription_id unless subscription_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#entitle_partner_subscription(name, entitle_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::EntitleSubscriptionResponse
Entitles a previously provisioned subscription to the current end user. The end user identity is inferred from the authorized credential of the request. This API must be authorized by the end user using OAuth.
300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 300 def entitle_partner_subscription(name, entitle_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:entitle', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::EntitleSubscriptionRequest::Representation command.request_object = entitle_subscription_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::EntitleSubscriptionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::EntitleSubscriptionResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#extend_partner_subscription(name, extend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ExtendSubscriptionResponse
[Opt-in only] Most partners should be on auto-extend by default. Extends a subscription service for their customers on an ongoing basis for the subscription to remain active and renewable. It should be called directly by the partner using service accounts.
337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 337 def extend_partner_subscription(name, extend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:extend', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::ExtendSubscriptionRequest::Representation command.request_object = extend_subscription_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::ExtendSubscriptionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::ExtendSubscriptionResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#find_partner_promotion_eligible(parent, find_eligible_promotions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::FindEligiblePromotionsResponse
Currently, it is only enabeld for YouTube. Finds eligible promotions for
the current user. The API requires user authorization via OAuth. The bare
minimum oauth scope openid is sufficient, which will skip the consent screen.
130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 130 def find_partner_promotion_eligible(parent, find_eligible_promotions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/promotions:findEligible', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::FindEligiblePromotionsRequest::Representation command.request_object = find_eligible_promotions_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::FindEligiblePromotionsResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::FindEligiblePromotionsResponse command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#generate_partner_user_session(parent, generate_user_session_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::GenerateUserSessionResponse
This API replaces user authorized OAuth consent based APIs (Create, Entitle). Issues a timed session token for the given user intent. You can use the session token to redirect the user to Google to finish the signup flow. You can re-generate new session token repeatedly for the same request if necessary, regardless of the previous tokens being expired or not. By default, the session token is valid for 1 hour.
608 609 610 611 612 613 614 615 616 617 618 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 608 def generate_partner_user_session(parent, generate_user_session_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/userSessions:generate', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GenerateUserSessionRequest::Representation command.request_object = generate_user_session_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GenerateUserSessionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GenerateUserSessionResponse command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_partner_subscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::Subscription
Gets a subscription by id. It should be called directly by the partner using service accounts.
371 372 373 374 375 376 377 378 379 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 371 def get_partner_subscription(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::Subscription::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::Subscription command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_partner_products(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ListProductsResponse
Currently, it doesn't support YouTube products. Retrieves the products that can be resold by the partner. It should be autenticated with a service account.
94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 94 def list_partner_products(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/products', ) command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::ListProductsResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::ListProductsResponse command.params['parent'] = parent unless parent.nil? command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_partner_promotions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ListPromotionsResponse
Currently, it doesn't support YouTube promotions. Retrieves the promotions, such as free trial, that can be used by the partner. It should be autenticated with a service account.
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 184 def list_partner_promotions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/promotions', ) command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::ListPromotionsResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::ListPromotionsResponse command.params['parent'] = parent unless parent.nil? command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_partner_subscription_line_item(name, subscription_line_item_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem
Updates a line item of a subscription. It should be autenticated with a service account.
569 570 571 572 573 574 575 576 577 578 579 580 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 569 def patch_partner_subscription_line_item(name, subscription_line_item_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem::Representation command.request_object = subscription_line_item_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::SubscriptionLineItem command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#provision_partner_subscription(parent, subscription_object = nil, cycle_options_initial_cycle_duration_count: nil, cycle_options_initial_cycle_duration_unit: nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::Subscription
Used by partners to provision a subscription for their customers. This creates a subscription without associating it with the end user account. EntitleSubscription must be called separately using OAuth in order for the end user account to be associated with the subscription. It should be called directly by the partner using service accounts.
416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 416 def provision_partner_subscription(parent, subscription_object = nil, cycle_options_initial_cycle_duration_count: nil, cycle_options_initial_cycle_duration_unit: nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/subscriptions:provision', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::Subscription::Representation command.request_object = subscription_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::Subscription::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::Subscription command.params['parent'] = parent unless parent.nil? command.query['cycleOptions.initialCycleDuration.count'] = unless .nil? command.query['cycleOptions.initialCycleDuration.unit'] = unless .nil? command.query['subscriptionId'] = subscription_id unless subscription_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#resume_partner_subscription(name, resume_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::ResumeSubscriptionResponse
Resumes a suspended subscription. The new billing cycle will start at the time of the request. It should be called directly by the partner using service accounts.
455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 455 def resume_partner_subscription(name, resume_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:resume', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::ResumeSubscriptionRequest::Representation command.request_object = resume_subscription_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::ResumeSubscriptionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::ResumeSubscriptionResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#suspend_partner_subscription(name, suspend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::SuspendSubscriptionResponse
Suspends a subscription. Contract terms may dictate if a prorated refund will be issued upon suspension. It should be called directly by the partner using service accounts.
491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 491 def suspend_partner_subscription(name, suspend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:suspend', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::SuspendSubscriptionRequest::Representation command.request_object = suspend_subscription_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::SuspendSubscriptionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::SuspendSubscriptionResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#undo_partner_subscription_cancel(name, undo_cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PaymentsresellersubscriptionV1::UndoCancelSubscriptionResponse
Currently, it is used by Google One, Play Pass partners. Revokes the
pending cancellation of a subscription, which is currently in
STATE_CANCEL_AT_END_OF_CYCLE state. If the subscription is already cancelled,
the request will fail. It should be called directly by the partner using
service accounts.
530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/google/apis/paymentsresellersubscription_v1/service.rb', line 530 def undo_partner_subscription_cancel(name, undo_cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:undoCancel', ) command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::UndoCancelSubscriptionRequest::Representation command.request_object = undo_cancel_subscription_request_object command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::UndoCancelSubscriptionResponse::Representation command.response_class = Google::Apis::PaymentsresellersubscriptionV1::UndoCancelSubscriptionResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |