google-apis-androidpublisher_v3 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2079,6 +2079,725 @@ module Google
2079
2079
  execute_or_queue_command(command, &block)
2080
2080
  end
2081
2081
 
2082
+ # Archives a subscription. Can only be done if at least one base plan was active
2083
+ # in the past, and no base plan is available for new or existing subscribers
2084
+ # currently. This action is irreversible, and the subscription ID will remain
2085
+ # reserved.
2086
+ # @param [String] package_name
2087
+ # Required. The parent app (package name) of the app of the subscription to
2088
+ # delete.
2089
+ # @param [String] product_id
2090
+ # Required. The unique product ID of the subscription to delete.
2091
+ # @param [Google::Apis::AndroidpublisherV3::ArchiveSubscriptionRequest] archive_subscription_request_object
2092
+ # @param [String] fields
2093
+ # Selector specifying which fields to include in a partial response.
2094
+ # @param [String] quota_user
2095
+ # Available to use for quota purposes for server-side applications. Can be any
2096
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2097
+ # @param [Google::Apis::RequestOptions] options
2098
+ # Request-specific options
2099
+ #
2100
+ # @yield [result, err] Result & error if block supplied
2101
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::Subscription] parsed result object
2102
+ # @yieldparam err [StandardError] error object if request failed
2103
+ #
2104
+ # @return [Google::Apis::AndroidpublisherV3::Subscription]
2105
+ #
2106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2109
+ def archive_subscription(package_name, product_id, archive_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2110
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive', options)
2111
+ command.request_representation = Google::Apis::AndroidpublisherV3::ArchiveSubscriptionRequest::Representation
2112
+ command.request_object = archive_subscription_request_object
2113
+ command.response_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2114
+ command.response_class = Google::Apis::AndroidpublisherV3::Subscription
2115
+ command.params['packageName'] = package_name unless package_name.nil?
2116
+ command.params['productId'] = product_id unless product_id.nil?
2117
+ command.query['fields'] = fields unless fields.nil?
2118
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2119
+ execute_or_queue_command(command, &block)
2120
+ end
2121
+
2122
+ # Creates a new subscription. Newly added base plans will remain in draft state
2123
+ # until activated.
2124
+ # @param [String] package_name
2125
+ # Required. The parent app (package name) for which the subscription should be
2126
+ # created. Must be equal to the package_name field on the Subscription resource.
2127
+ # @param [Google::Apis::AndroidpublisherV3::Subscription] subscription_object
2128
+ # @param [String] product_id
2129
+ # Required. The ID to use for the subscription. For the requirements on this
2130
+ # format, see the documentation of the product_id field on the Subscription
2131
+ # resource.
2132
+ # @param [String] regions_version_version
2133
+ # Required. A string representing version of the available regions being used
2134
+ # for the specified resource.
2135
+ # @param [String] fields
2136
+ # Selector specifying which fields to include in a partial response.
2137
+ # @param [String] quota_user
2138
+ # Available to use for quota purposes for server-side applications. Can be any
2139
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2140
+ # @param [Google::Apis::RequestOptions] options
2141
+ # Request-specific options
2142
+ #
2143
+ # @yield [result, err] Result & error if block supplied
2144
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::Subscription] parsed result object
2145
+ # @yieldparam err [StandardError] error object if request failed
2146
+ #
2147
+ # @return [Google::Apis::AndroidpublisherV3::Subscription]
2148
+ #
2149
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2150
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2151
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2152
+ def create_monetization_subscription(package_name, subscription_object = nil, product_id: nil, regions_version_version: nil, fields: nil, quota_user: nil, options: nil, &block)
2153
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions', options)
2154
+ command.request_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2155
+ command.request_object = subscription_object
2156
+ command.response_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2157
+ command.response_class = Google::Apis::AndroidpublisherV3::Subscription
2158
+ command.params['packageName'] = package_name unless package_name.nil?
2159
+ command.query['productId'] = product_id unless product_id.nil?
2160
+ command.query['regionsVersion.version'] = regions_version_version unless regions_version_version.nil?
2161
+ command.query['fields'] = fields unless fields.nil?
2162
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2163
+ execute_or_queue_command(command, &block)
2164
+ end
2165
+
2166
+ # Deletes a subscription. A subscription can only be deleted if it has never had
2167
+ # a base plan published.
2168
+ # @param [String] package_name
2169
+ # Required. The parent app (package name) of the app of the subscription to
2170
+ # delete.
2171
+ # @param [String] product_id
2172
+ # Required. The unique product ID of the subscription to delete.
2173
+ # @param [String] fields
2174
+ # Selector specifying which fields to include in a partial response.
2175
+ # @param [String] quota_user
2176
+ # Available to use for quota purposes for server-side applications. Can be any
2177
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2178
+ # @param [Google::Apis::RequestOptions] options
2179
+ # Request-specific options
2180
+ #
2181
+ # @yield [result, err] Result & error if block supplied
2182
+ # @yieldparam result [NilClass] No result returned for this method
2183
+ # @yieldparam err [StandardError] error object if request failed
2184
+ #
2185
+ # @return [void]
2186
+ #
2187
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2188
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2189
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2190
+ def delete_monetization_subscription(package_name, product_id, fields: nil, quota_user: nil, options: nil, &block)
2191
+ command = make_simple_command(:delete, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}', options)
2192
+ command.params['packageName'] = package_name unless package_name.nil?
2193
+ command.params['productId'] = product_id unless product_id.nil?
2194
+ command.query['fields'] = fields unless fields.nil?
2195
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2196
+ execute_or_queue_command(command, &block)
2197
+ end
2198
+
2199
+ # Reads a single subscription.
2200
+ # @param [String] package_name
2201
+ # Required. The parent app (package name) of the subscription to get.
2202
+ # @param [String] product_id
2203
+ # Required. The unique product ID of the subscription to get.
2204
+ # @param [String] fields
2205
+ # Selector specifying which fields to include in a partial response.
2206
+ # @param [String] quota_user
2207
+ # Available to use for quota purposes for server-side applications. Can be any
2208
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2209
+ # @param [Google::Apis::RequestOptions] options
2210
+ # Request-specific options
2211
+ #
2212
+ # @yield [result, err] Result & error if block supplied
2213
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::Subscription] parsed result object
2214
+ # @yieldparam err [StandardError] error object if request failed
2215
+ #
2216
+ # @return [Google::Apis::AndroidpublisherV3::Subscription]
2217
+ #
2218
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2219
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2220
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2221
+ def get_monetization_subscription(package_name, product_id, fields: nil, quota_user: nil, options: nil, &block)
2222
+ command = make_simple_command(:get, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}', options)
2223
+ command.response_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2224
+ command.response_class = Google::Apis::AndroidpublisherV3::Subscription
2225
+ command.params['packageName'] = package_name unless package_name.nil?
2226
+ command.params['productId'] = product_id unless product_id.nil?
2227
+ command.query['fields'] = fields unless fields.nil?
2228
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2229
+ execute_or_queue_command(command, &block)
2230
+ end
2231
+
2232
+ # Lists all subscriptions under a given app.
2233
+ # @param [String] package_name
2234
+ # Required. The parent app (package name) for which the subscriptions should be
2235
+ # read.
2236
+ # @param [Fixnum] page_size
2237
+ # The maximum number of subscriptions to return. The service may return fewer
2238
+ # than this value. If unspecified, at most 50 subscriptions will be returned.
2239
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2240
+ # @param [String] page_token
2241
+ # A page token, received from a previous `ListSubscriptions` call. Provide this
2242
+ # to retrieve the subsequent page. When paginating, all other parameters
2243
+ # provided to `ListSubscriptions` must match the call that provided the page
2244
+ # token.
2245
+ # @param [Boolean] show_archived
2246
+ # Whether archived subscriptions should be included in the response. Defaults to
2247
+ # false.
2248
+ # @param [String] fields
2249
+ # Selector specifying which fields to include in a partial response.
2250
+ # @param [String] quota_user
2251
+ # Available to use for quota purposes for server-side applications. Can be any
2252
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2253
+ # @param [Google::Apis::RequestOptions] options
2254
+ # Request-specific options
2255
+ #
2256
+ # @yield [result, err] Result & error if block supplied
2257
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::ListSubscriptionsResponse] parsed result object
2258
+ # @yieldparam err [StandardError] error object if request failed
2259
+ #
2260
+ # @return [Google::Apis::AndroidpublisherV3::ListSubscriptionsResponse]
2261
+ #
2262
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2263
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2264
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2265
+ def list_monetization_subscriptions(package_name, page_size: nil, page_token: nil, show_archived: nil, fields: nil, quota_user: nil, options: nil, &block)
2266
+ command = make_simple_command(:get, 'androidpublisher/v3/applications/{packageName}/subscriptions', options)
2267
+ command.response_representation = Google::Apis::AndroidpublisherV3::ListSubscriptionsResponse::Representation
2268
+ command.response_class = Google::Apis::AndroidpublisherV3::ListSubscriptionsResponse
2269
+ command.params['packageName'] = package_name unless package_name.nil?
2270
+ command.query['pageSize'] = page_size unless page_size.nil?
2271
+ command.query['pageToken'] = page_token unless page_token.nil?
2272
+ command.query['showArchived'] = show_archived unless show_archived.nil?
2273
+ command.query['fields'] = fields unless fields.nil?
2274
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2275
+ execute_or_queue_command(command, &block)
2276
+ end
2277
+
2278
+ # Updates an existing subscription.
2279
+ # @param [String] package_name
2280
+ # Immutable. Package name of the parent app.
2281
+ # @param [String] product_id
2282
+ # Immutable. Unique product ID of the product. Unique within the parent app.
2283
+ # Product IDs must be composed of lower-case letters (a-z), numbers (0-9),
2284
+ # underscores (_) and dots (.). It must start with a lower-case letter or number,
2285
+ # and be between 1 and 40 (inclusive) characters in length.
2286
+ # @param [Google::Apis::AndroidpublisherV3::Subscription] subscription_object
2287
+ # @param [String] regions_version_version
2288
+ # Required. A string representing version of the available regions being used
2289
+ # for the specified resource.
2290
+ # @param [String] update_mask
2291
+ # Required. The list of fields to be updated.
2292
+ # @param [String] fields
2293
+ # Selector specifying which fields to include in a partial response.
2294
+ # @param [String] quota_user
2295
+ # Available to use for quota purposes for server-side applications. Can be any
2296
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2297
+ # @param [Google::Apis::RequestOptions] options
2298
+ # Request-specific options
2299
+ #
2300
+ # @yield [result, err] Result & error if block supplied
2301
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::Subscription] parsed result object
2302
+ # @yieldparam err [StandardError] error object if request failed
2303
+ #
2304
+ # @return [Google::Apis::AndroidpublisherV3::Subscription]
2305
+ #
2306
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2307
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2308
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2309
+ def patch_monetization_subscription(package_name, product_id, subscription_object = nil, regions_version_version: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2310
+ command = make_simple_command(:patch, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}', options)
2311
+ command.request_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2312
+ command.request_object = subscription_object
2313
+ command.response_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2314
+ command.response_class = Google::Apis::AndroidpublisherV3::Subscription
2315
+ command.params['packageName'] = package_name unless package_name.nil?
2316
+ command.params['productId'] = product_id unless product_id.nil?
2317
+ command.query['regionsVersion.version'] = regions_version_version unless regions_version_version.nil?
2318
+ command.query['updateMask'] = update_mask unless update_mask.nil?
2319
+ command.query['fields'] = fields unless fields.nil?
2320
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2321
+ execute_or_queue_command(command, &block)
2322
+ end
2323
+
2324
+ # Activates a base plan. Once activated, base plans will be available to new
2325
+ # subscribers.
2326
+ # @param [String] package_name
2327
+ # Required. The parent app (package name) of the base plan to activate.
2328
+ # @param [String] product_id
2329
+ # Required. The parent subscription (ID) of the base plan to activate.
2330
+ # @param [String] base_plan_id
2331
+ # Required. The unique base plan ID of the base plan to activate.
2332
+ # @param [Google::Apis::AndroidpublisherV3::ActivateBasePlanRequest] activate_base_plan_request_object
2333
+ # @param [String] fields
2334
+ # Selector specifying which fields to include in a partial response.
2335
+ # @param [String] quota_user
2336
+ # Available to use for quota purposes for server-side applications. Can be any
2337
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2338
+ # @param [Google::Apis::RequestOptions] options
2339
+ # Request-specific options
2340
+ #
2341
+ # @yield [result, err] Result & error if block supplied
2342
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::Subscription] parsed result object
2343
+ # @yieldparam err [StandardError] error object if request failed
2344
+ #
2345
+ # @return [Google::Apis::AndroidpublisherV3::Subscription]
2346
+ #
2347
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2348
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2349
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2350
+ def activate_base_plan(package_name, product_id, base_plan_id, activate_base_plan_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2351
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate', options)
2352
+ command.request_representation = Google::Apis::AndroidpublisherV3::ActivateBasePlanRequest::Representation
2353
+ command.request_object = activate_base_plan_request_object
2354
+ command.response_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2355
+ command.response_class = Google::Apis::AndroidpublisherV3::Subscription
2356
+ command.params['packageName'] = package_name unless package_name.nil?
2357
+ command.params['productId'] = product_id unless product_id.nil?
2358
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2359
+ command.query['fields'] = fields unless fields.nil?
2360
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2361
+ execute_or_queue_command(command, &block)
2362
+ end
2363
+
2364
+ # Deactivates a base plan. Once deactivated, the base plan will become
2365
+ # unavailable to new subscribers, but existing subscribers will maintain their
2366
+ # subscription
2367
+ # @param [String] package_name
2368
+ # Required. The parent app (package name) of the base plan to deactivate.
2369
+ # @param [String] product_id
2370
+ # Required. The parent subscription (ID) of the base plan to deactivate.
2371
+ # @param [String] base_plan_id
2372
+ # Required. The unique base plan ID of the base plan to deactivate.
2373
+ # @param [Google::Apis::AndroidpublisherV3::DeactivateBasePlanRequest] deactivate_base_plan_request_object
2374
+ # @param [String] fields
2375
+ # Selector specifying which fields to include in a partial response.
2376
+ # @param [String] quota_user
2377
+ # Available to use for quota purposes for server-side applications. Can be any
2378
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2379
+ # @param [Google::Apis::RequestOptions] options
2380
+ # Request-specific options
2381
+ #
2382
+ # @yield [result, err] Result & error if block supplied
2383
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::Subscription] parsed result object
2384
+ # @yieldparam err [StandardError] error object if request failed
2385
+ #
2386
+ # @return [Google::Apis::AndroidpublisherV3::Subscription]
2387
+ #
2388
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2389
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2390
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2391
+ def deactivate_base_plan(package_name, product_id, base_plan_id, deactivate_base_plan_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2392
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate', options)
2393
+ command.request_representation = Google::Apis::AndroidpublisherV3::DeactivateBasePlanRequest::Representation
2394
+ command.request_object = deactivate_base_plan_request_object
2395
+ command.response_representation = Google::Apis::AndroidpublisherV3::Subscription::Representation
2396
+ command.response_class = Google::Apis::AndroidpublisherV3::Subscription
2397
+ command.params['packageName'] = package_name unless package_name.nil?
2398
+ command.params['productId'] = product_id unless product_id.nil?
2399
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2400
+ command.query['fields'] = fields unless fields.nil?
2401
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2402
+ execute_or_queue_command(command, &block)
2403
+ end
2404
+
2405
+ # Deletes a base plan. Can only be done for draft base plans. This action is
2406
+ # irreversible.
2407
+ # @param [String] package_name
2408
+ # Required. The parent app (package name) of the base plan to delete.
2409
+ # @param [String] product_id
2410
+ # Required. The parent subscription (ID) of the base plan to delete.
2411
+ # @param [String] base_plan_id
2412
+ # Required. The unique offer ID of the base plan to delete.
2413
+ # @param [String] fields
2414
+ # Selector specifying which fields to include in a partial response.
2415
+ # @param [String] quota_user
2416
+ # Available to use for quota purposes for server-side applications. Can be any
2417
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2418
+ # @param [Google::Apis::RequestOptions] options
2419
+ # Request-specific options
2420
+ #
2421
+ # @yield [result, err] Result & error if block supplied
2422
+ # @yieldparam result [NilClass] No result returned for this method
2423
+ # @yieldparam err [StandardError] error object if request failed
2424
+ #
2425
+ # @return [void]
2426
+ #
2427
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2428
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2429
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2430
+ def delete_monetization_subscription_base_plan(package_name, product_id, base_plan_id, fields: nil, quota_user: nil, options: nil, &block)
2431
+ command = make_simple_command(:delete, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}', options)
2432
+ command.params['packageName'] = package_name unless package_name.nil?
2433
+ command.params['productId'] = product_id unless product_id.nil?
2434
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2435
+ command.query['fields'] = fields unless fields.nil?
2436
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2437
+ execute_or_queue_command(command, &block)
2438
+ end
2439
+
2440
+ # Migrates subscribers who are receiving an historical subscription price to the
2441
+ # currently-offered price for the specified region. Requests will cause price
2442
+ # change notifications to be sent to users who are currently receiving an
2443
+ # historical price older than the supplied timestamp. Subscribers who do not
2444
+ # agree to the new price will have their subscription ended at the next renewal.
2445
+ # @param [String] package_name
2446
+ # Required. Package name of the parent app. Must be equal to the package_name
2447
+ # field on the Subscription resource.
2448
+ # @param [String] product_id
2449
+ # Required. The ID of the subscription to update. Must be equal to the
2450
+ # product_id field on the Subscription resource.
2451
+ # @param [String] base_plan_id
2452
+ # Required. The unique base plan ID of the base plan to update prices on.
2453
+ # @param [Google::Apis::AndroidpublisherV3::MigrateBasePlanPricesRequest] migrate_base_plan_prices_request_object
2454
+ # @param [String] fields
2455
+ # Selector specifying which fields to include in a partial response.
2456
+ # @param [String] quota_user
2457
+ # Available to use for quota purposes for server-side applications. Can be any
2458
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2459
+ # @param [Google::Apis::RequestOptions] options
2460
+ # Request-specific options
2461
+ #
2462
+ # @yield [result, err] Result & error if block supplied
2463
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::MigrateBasePlanPricesResponse] parsed result object
2464
+ # @yieldparam err [StandardError] error object if request failed
2465
+ #
2466
+ # @return [Google::Apis::AndroidpublisherV3::MigrateBasePlanPricesResponse]
2467
+ #
2468
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2469
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2470
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2471
+ def migrate_monetization_subscription_base_plan_prices(package_name, product_id, base_plan_id, migrate_base_plan_prices_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2472
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices', options)
2473
+ command.request_representation = Google::Apis::AndroidpublisherV3::MigrateBasePlanPricesRequest::Representation
2474
+ command.request_object = migrate_base_plan_prices_request_object
2475
+ command.response_representation = Google::Apis::AndroidpublisherV3::MigrateBasePlanPricesResponse::Representation
2476
+ command.response_class = Google::Apis::AndroidpublisherV3::MigrateBasePlanPricesResponse
2477
+ command.params['packageName'] = package_name unless package_name.nil?
2478
+ command.params['productId'] = product_id unless product_id.nil?
2479
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2480
+ command.query['fields'] = fields unless fields.nil?
2481
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2482
+ execute_or_queue_command(command, &block)
2483
+ end
2484
+
2485
+ # Activates a subscription offer. Once activated, subscription offers will be
2486
+ # available to new subscribers.
2487
+ # @param [String] package_name
2488
+ # Required. The parent app (package name) of the offer to activate.
2489
+ # @param [String] product_id
2490
+ # Required. The parent subscription (ID) of the offer to activate.
2491
+ # @param [String] base_plan_id
2492
+ # Required. The parent base plan (ID) of the offer to activate.
2493
+ # @param [String] offer_id
2494
+ # Required. The unique offer ID of the offer to activate.
2495
+ # @param [Google::Apis::AndroidpublisherV3::ActivateSubscriptionOfferRequest] activate_subscription_offer_request_object
2496
+ # @param [String] fields
2497
+ # Selector specifying which fields to include in a partial response.
2498
+ # @param [String] quota_user
2499
+ # Available to use for quota purposes for server-side applications. Can be any
2500
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2501
+ # @param [Google::Apis::RequestOptions] options
2502
+ # Request-specific options
2503
+ #
2504
+ # @yield [result, err] Result & error if block supplied
2505
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::SubscriptionOffer] parsed result object
2506
+ # @yieldparam err [StandardError] error object if request failed
2507
+ #
2508
+ # @return [Google::Apis::AndroidpublisherV3::SubscriptionOffer]
2509
+ #
2510
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2511
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2512
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2513
+ def activate_subscription_offer(package_name, product_id, base_plan_id, offer_id, activate_subscription_offer_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2514
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate', options)
2515
+ command.request_representation = Google::Apis::AndroidpublisherV3::ActivateSubscriptionOfferRequest::Representation
2516
+ command.request_object = activate_subscription_offer_request_object
2517
+ command.response_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2518
+ command.response_class = Google::Apis::AndroidpublisherV3::SubscriptionOffer
2519
+ command.params['packageName'] = package_name unless package_name.nil?
2520
+ command.params['productId'] = product_id unless product_id.nil?
2521
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2522
+ command.params['offerId'] = offer_id unless offer_id.nil?
2523
+ command.query['fields'] = fields unless fields.nil?
2524
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2525
+ execute_or_queue_command(command, &block)
2526
+ end
2527
+
2528
+ # Creates a new subscription offer. Only auto-renewing base plans can have
2529
+ # subscription offers. The offer state will be DRAFT until it is activated.
2530
+ # @param [String] package_name
2531
+ # Required. The parent app (package name) for which the offer should be created.
2532
+ # Must be equal to the package_name field on the Subscription resource.
2533
+ # @param [String] product_id
2534
+ # Required. The parent subscription (ID) for which the offer should be created.
2535
+ # Must be equal to the product_id field on the SubscriptionOffer resource.
2536
+ # @param [String] base_plan_id
2537
+ # Required. The parent base plan (ID) for which the offer should be created.
2538
+ # Must be equal to the base_plan_id field on the SubscriptionOffer resource.
2539
+ # @param [Google::Apis::AndroidpublisherV3::SubscriptionOffer] subscription_offer_object
2540
+ # @param [String] offer_id
2541
+ # Required. The ID to use for the offer. For the requirements on this format,
2542
+ # see the documentation of the offer_id field on the SubscriptionOffer resource.
2543
+ # @param [String] regions_version_version
2544
+ # Required. A string representing version of the available regions being used
2545
+ # for the specified resource.
2546
+ # @param [String] fields
2547
+ # Selector specifying which fields to include in a partial response.
2548
+ # @param [String] quota_user
2549
+ # Available to use for quota purposes for server-side applications. Can be any
2550
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2551
+ # @param [Google::Apis::RequestOptions] options
2552
+ # Request-specific options
2553
+ #
2554
+ # @yield [result, err] Result & error if block supplied
2555
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::SubscriptionOffer] parsed result object
2556
+ # @yieldparam err [StandardError] error object if request failed
2557
+ #
2558
+ # @return [Google::Apis::AndroidpublisherV3::SubscriptionOffer]
2559
+ #
2560
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2561
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2562
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2563
+ def create_monetization_subscription_base_plan_offer(package_name, product_id, base_plan_id, subscription_offer_object = nil, offer_id: nil, regions_version_version: nil, fields: nil, quota_user: nil, options: nil, &block)
2564
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers', options)
2565
+ command.request_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2566
+ command.request_object = subscription_offer_object
2567
+ command.response_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2568
+ command.response_class = Google::Apis::AndroidpublisherV3::SubscriptionOffer
2569
+ command.params['packageName'] = package_name unless package_name.nil?
2570
+ command.params['productId'] = product_id unless product_id.nil?
2571
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2572
+ command.query['offerId'] = offer_id unless offer_id.nil?
2573
+ command.query['regionsVersion.version'] = regions_version_version unless regions_version_version.nil?
2574
+ command.query['fields'] = fields unless fields.nil?
2575
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2576
+ execute_or_queue_command(command, &block)
2577
+ end
2578
+
2579
+ # Deactivates a subscription offer. Once deactivated, existing subscribers will
2580
+ # maintain their subscription, but the offer will become unavailable to new
2581
+ # subscribers.
2582
+ # @param [String] package_name
2583
+ # Required. The parent app (package name) of the offer to deactivate.
2584
+ # @param [String] product_id
2585
+ # Required. The parent subscription (ID) of the offer to deactivate.
2586
+ # @param [String] base_plan_id
2587
+ # Required. The parent base plan (ID) of the offer to deactivate.
2588
+ # @param [String] offer_id
2589
+ # Required. The unique offer ID of the offer to deactivate.
2590
+ # @param [Google::Apis::AndroidpublisherV3::DeactivateSubscriptionOfferRequest] deactivate_subscription_offer_request_object
2591
+ # @param [String] fields
2592
+ # Selector specifying which fields to include in a partial response.
2593
+ # @param [String] quota_user
2594
+ # Available to use for quota purposes for server-side applications. Can be any
2595
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2596
+ # @param [Google::Apis::RequestOptions] options
2597
+ # Request-specific options
2598
+ #
2599
+ # @yield [result, err] Result & error if block supplied
2600
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::SubscriptionOffer] parsed result object
2601
+ # @yieldparam err [StandardError] error object if request failed
2602
+ #
2603
+ # @return [Google::Apis::AndroidpublisherV3::SubscriptionOffer]
2604
+ #
2605
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2606
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2607
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2608
+ def deactivate_subscription_offer(package_name, product_id, base_plan_id, offer_id, deactivate_subscription_offer_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2609
+ command = make_simple_command(:post, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate', options)
2610
+ command.request_representation = Google::Apis::AndroidpublisherV3::DeactivateSubscriptionOfferRequest::Representation
2611
+ command.request_object = deactivate_subscription_offer_request_object
2612
+ command.response_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2613
+ command.response_class = Google::Apis::AndroidpublisherV3::SubscriptionOffer
2614
+ command.params['packageName'] = package_name unless package_name.nil?
2615
+ command.params['productId'] = product_id unless product_id.nil?
2616
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2617
+ command.params['offerId'] = offer_id unless offer_id.nil?
2618
+ command.query['fields'] = fields unless fields.nil?
2619
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2620
+ execute_or_queue_command(command, &block)
2621
+ end
2622
+
2623
+ # Deletes a subscription offer. Can only be done for draft offers. This action
2624
+ # is irreversible.
2625
+ # @param [String] package_name
2626
+ # Required. The parent app (package name) of the offer to delete.
2627
+ # @param [String] product_id
2628
+ # Required. The parent subscription (ID) of the offer to delete.
2629
+ # @param [String] base_plan_id
2630
+ # Required. The parent base plan (ID) of the offer to delete.
2631
+ # @param [String] offer_id
2632
+ # Required. The unique offer ID of the offer to delete.
2633
+ # @param [String] fields
2634
+ # Selector specifying which fields to include in a partial response.
2635
+ # @param [String] quota_user
2636
+ # Available to use for quota purposes for server-side applications. Can be any
2637
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2638
+ # @param [Google::Apis::RequestOptions] options
2639
+ # Request-specific options
2640
+ #
2641
+ # @yield [result, err] Result & error if block supplied
2642
+ # @yieldparam result [NilClass] No result returned for this method
2643
+ # @yieldparam err [StandardError] error object if request failed
2644
+ #
2645
+ # @return [void]
2646
+ #
2647
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2648
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2649
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2650
+ def delete_monetization_subscription_base_plan_offer(package_name, product_id, base_plan_id, offer_id, fields: nil, quota_user: nil, options: nil, &block)
2651
+ command = make_simple_command(:delete, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}', options)
2652
+ command.params['packageName'] = package_name unless package_name.nil?
2653
+ command.params['productId'] = product_id unless product_id.nil?
2654
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2655
+ command.params['offerId'] = offer_id unless offer_id.nil?
2656
+ command.query['fields'] = fields unless fields.nil?
2657
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2658
+ execute_or_queue_command(command, &block)
2659
+ end
2660
+
2661
+ # Reads a single offer
2662
+ # @param [String] package_name
2663
+ # Required. The parent app (package name) of the offer to get.
2664
+ # @param [String] product_id
2665
+ # Required. The parent subscription (ID) of the offer to get.
2666
+ # @param [String] base_plan_id
2667
+ # Required. The parent base plan (ID) of the offer to get.
2668
+ # @param [String] offer_id
2669
+ # Required. The unique offer ID of the offer to get.
2670
+ # @param [String] fields
2671
+ # Selector specifying which fields to include in a partial response.
2672
+ # @param [String] quota_user
2673
+ # Available to use for quota purposes for server-side applications. Can be any
2674
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2675
+ # @param [Google::Apis::RequestOptions] options
2676
+ # Request-specific options
2677
+ #
2678
+ # @yield [result, err] Result & error if block supplied
2679
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::SubscriptionOffer] parsed result object
2680
+ # @yieldparam err [StandardError] error object if request failed
2681
+ #
2682
+ # @return [Google::Apis::AndroidpublisherV3::SubscriptionOffer]
2683
+ #
2684
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2685
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2686
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2687
+ def get_monetization_subscription_base_plan_offer(package_name, product_id, base_plan_id, offer_id, fields: nil, quota_user: nil, options: nil, &block)
2688
+ command = make_simple_command(:get, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}', options)
2689
+ command.response_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2690
+ command.response_class = Google::Apis::AndroidpublisherV3::SubscriptionOffer
2691
+ command.params['packageName'] = package_name unless package_name.nil?
2692
+ command.params['productId'] = product_id unless product_id.nil?
2693
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2694
+ command.params['offerId'] = offer_id unless offer_id.nil?
2695
+ command.query['fields'] = fields unless fields.nil?
2696
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2697
+ execute_or_queue_command(command, &block)
2698
+ end
2699
+
2700
+ # Lists all offers under a given subscription.
2701
+ # @param [String] package_name
2702
+ # Required. The parent app (package name) for which the subscriptions should be
2703
+ # read.
2704
+ # @param [String] product_id
2705
+ # Required. The parent subscription (ID) for which the offers should be read.
2706
+ # @param [String] base_plan_id
2707
+ # Required. The parent base plan (ID) for which the offers should be read. May
2708
+ # be specified as '-' to read all offers under a subscription.
2709
+ # @param [Fixnum] page_size
2710
+ # The maximum number of subscriptions to return. The service may return fewer
2711
+ # than this value. If unspecified, at most 50 subscriptions will be returned.
2712
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2713
+ # @param [String] page_token
2714
+ # A page token, received from a previous `ListSubscriptionsOffers` call. Provide
2715
+ # this to retrieve the subsequent page. When paginating, all other parameters
2716
+ # provided to `ListSubscriptionOffers` must match the call that provided the
2717
+ # page token.
2718
+ # @param [String] fields
2719
+ # Selector specifying which fields to include in a partial response.
2720
+ # @param [String] quota_user
2721
+ # Available to use for quota purposes for server-side applications. Can be any
2722
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2723
+ # @param [Google::Apis::RequestOptions] options
2724
+ # Request-specific options
2725
+ #
2726
+ # @yield [result, err] Result & error if block supplied
2727
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::ListSubscriptionOffersResponse] parsed result object
2728
+ # @yieldparam err [StandardError] error object if request failed
2729
+ #
2730
+ # @return [Google::Apis::AndroidpublisherV3::ListSubscriptionOffersResponse]
2731
+ #
2732
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2733
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2734
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2735
+ def list_monetization_subscription_base_plan_offers(package_name, product_id, base_plan_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2736
+ command = make_simple_command(:get, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers', options)
2737
+ command.response_representation = Google::Apis::AndroidpublisherV3::ListSubscriptionOffersResponse::Representation
2738
+ command.response_class = Google::Apis::AndroidpublisherV3::ListSubscriptionOffersResponse
2739
+ command.params['packageName'] = package_name unless package_name.nil?
2740
+ command.params['productId'] = product_id unless product_id.nil?
2741
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2742
+ command.query['pageSize'] = page_size unless page_size.nil?
2743
+ command.query['pageToken'] = page_token unless page_token.nil?
2744
+ command.query['fields'] = fields unless fields.nil?
2745
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2746
+ execute_or_queue_command(command, &block)
2747
+ end
2748
+
2749
+ # Updates an existing subscription offer.
2750
+ # @param [String] package_name
2751
+ # Required. Immutable. The package name of the app the parent subscription
2752
+ # belongs to.
2753
+ # @param [String] product_id
2754
+ # Required. Immutable. The ID of the parent subscription this offer belongs to.
2755
+ # @param [String] base_plan_id
2756
+ # Required. Immutable. The ID of the base plan to which this offer is an
2757
+ # extension.
2758
+ # @param [String] offer_id
2759
+ # Required. Immutable. Unique ID of this subscription offer. Must be unique
2760
+ # within the base plan.
2761
+ # @param [Google::Apis::AndroidpublisherV3::SubscriptionOffer] subscription_offer_object
2762
+ # @param [String] regions_version_version
2763
+ # Required. A string representing version of the available regions being used
2764
+ # for the specified resource.
2765
+ # @param [String] update_mask
2766
+ # Required. The list of fields to be updated.
2767
+ # @param [String] fields
2768
+ # Selector specifying which fields to include in a partial response.
2769
+ # @param [String] quota_user
2770
+ # Available to use for quota purposes for server-side applications. Can be any
2771
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2772
+ # @param [Google::Apis::RequestOptions] options
2773
+ # Request-specific options
2774
+ #
2775
+ # @yield [result, err] Result & error if block supplied
2776
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::SubscriptionOffer] parsed result object
2777
+ # @yieldparam err [StandardError] error object if request failed
2778
+ #
2779
+ # @return [Google::Apis::AndroidpublisherV3::SubscriptionOffer]
2780
+ #
2781
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2782
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2783
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2784
+ def patch_monetization_subscription_base_plan_offer(package_name, product_id, base_plan_id, offer_id, subscription_offer_object = nil, regions_version_version: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2785
+ command = make_simple_command(:patch, 'androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}', options)
2786
+ command.request_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2787
+ command.request_object = subscription_offer_object
2788
+ command.response_representation = Google::Apis::AndroidpublisherV3::SubscriptionOffer::Representation
2789
+ command.response_class = Google::Apis::AndroidpublisherV3::SubscriptionOffer
2790
+ command.params['packageName'] = package_name unless package_name.nil?
2791
+ command.params['productId'] = product_id unless product_id.nil?
2792
+ command.params['basePlanId'] = base_plan_id unless base_plan_id.nil?
2793
+ command.params['offerId'] = offer_id unless offer_id.nil?
2794
+ command.query['regionsVersion.version'] = regions_version_version unless regions_version_version.nil?
2795
+ command.query['updateMask'] = update_mask unless update_mask.nil?
2796
+ command.query['fields'] = fields unless fields.nil?
2797
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2798
+ execute_or_queue_command(command, &block)
2799
+ end
2800
+
2082
2801
  # Refunds a user's subscription or in-app purchase order. Orders older than 1
2083
2802
  # year cannot be refunded.
2084
2803
  # @param [String] package_name
@@ -2418,6 +3137,41 @@ module Google
2418
3137
  execute_or_queue_command(command, &block)
2419
3138
  end
2420
3139
 
3140
+ # Get metadata about a subscription
3141
+ # @param [String] package_name
3142
+ # The package of the application for which this subscription was purchased (for
3143
+ # example, 'com.some.thing').
3144
+ # @param [String] token
3145
+ # Required. The token provided to the user's device when the subscription was
3146
+ # purchased.
3147
+ # @param [String] fields
3148
+ # Selector specifying which fields to include in a partial response.
3149
+ # @param [String] quota_user
3150
+ # Available to use for quota purposes for server-side applications. Can be any
3151
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3152
+ # @param [Google::Apis::RequestOptions] options
3153
+ # Request-specific options
3154
+ #
3155
+ # @yield [result, err] Result & error if block supplied
3156
+ # @yieldparam result [Google::Apis::AndroidpublisherV3::SubscriptionPurchaseV2] parsed result object
3157
+ # @yieldparam err [StandardError] error object if request failed
3158
+ #
3159
+ # @return [Google::Apis::AndroidpublisherV3::SubscriptionPurchaseV2]
3160
+ #
3161
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3162
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3163
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3164
+ def get_purchase_subscriptionsv2(package_name, token, fields: nil, quota_user: nil, options: nil, &block)
3165
+ command = make_simple_command(:get, 'androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}', options)
3166
+ command.response_representation = Google::Apis::AndroidpublisherV3::SubscriptionPurchaseV2::Representation
3167
+ command.response_class = Google::Apis::AndroidpublisherV3::SubscriptionPurchaseV2
3168
+ command.params['packageName'] = package_name unless package_name.nil?
3169
+ command.params['token'] = token unless token.nil?
3170
+ command.query['fields'] = fields unless fields.nil?
3171
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3172
+ execute_or_queue_command(command, &block)
3173
+ end
3174
+
2421
3175
  # Lists the purchases that were canceled, refunded or charged-back.
2422
3176
  # @param [String] package_name
2423
3177
  # The package name of the application for which voided purchases need to be