diff --git a/androidpublisher/v3/androidpublisher-api.json b/androidpublisher/v3/androidpublisher-api.json index 0c29fc21bd9..def08a646d3 100644 --- a/androidpublisher/v3/androidpublisher-api.json +++ b/androidpublisher/v3/androidpublisher-api.json @@ -2336,6 +2336,739 @@ "https://www.googleapis.com/auth/androidpublisher" ] } + }, + "resources": { + "subscriptions": { + "methods": { + "archive": { + "description": "Archives a subscription. Can only be done if at least one base plan was active in the past, and no base plan is available for new or existing subscribers currently. This action is irreversible, and the subscription ID will remain reserved.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.archive", + "parameterOrder": [ + "packageName", + "productId" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) of the app of the subscription to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The unique product ID of the subscription to delete.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", + "request": { + "$ref": "ArchiveSubscriptionRequest" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "create": { + "description": "Creates a new subscription. Newly added base plans will remain in draft state until activated.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.create", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) for which the subscription should be created. Must be equal to the package_name field on the Subscription resource.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The ID to use for the subscription. For the requirements on this format, see the documentation of the product_id field on the Subscription resource.", + "location": "query", + "type": "string" + }, + "regionsVersion.version": { + "description": "Required. A string representing version of the available regions being used for the specified resource.", + "location": "query", + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions", + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "delete": { + "description": "Deletes a subscription. A subscription can only be deleted if it has never had a base plan published.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + "httpMethod": "DELETE", + "id": "androidpublisher.monetization.subscriptions.delete", + "parameterOrder": [ + "packageName", + "productId" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) of the app of the subscription to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The unique product ID of the subscription to delete.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "description": "Reads a single subscription.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + "httpMethod": "GET", + "id": "androidpublisher.monetization.subscriptions.get", + "parameterOrder": [ + "packageName", + "productId" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) of the subscription to get.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The unique product ID of the subscription to get.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "description": "Lists all subscriptions under a given app.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", + "httpMethod": "GET", + "id": "androidpublisher.monetization.subscriptions.list", + "parameterOrder": [ + "packageName" + ], + "parameters": { + "packageName": { + "description": "Required. The parent app (package name) for which the subscriptions should be read.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The maximum number of subscriptions to return. The service may return fewer than this value. If unspecified, at most 50 subscriptions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListSubscriptions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptions` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "showArchived": { + "description": "Whether archived subscriptions should be included in the response. Defaults to false.", + "location": "query", + "type": "boolean" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions", + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "description": "Updates an existing subscription.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + "httpMethod": "PATCH", + "id": "androidpublisher.monetization.subscriptions.patch", + "parameterOrder": [ + "packageName", + "productId" + ], + "parameters": { + "packageName": { + "description": "Immutable. Package name of the parent app.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length.", + "location": "path", + "required": true, + "type": "string" + }, + "regionsVersion.version": { + "description": "Required. A string representing version of the available regions being used for the specified resource.", + "location": "query", + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + }, + "resources": { + "basePlans": { + "methods": { + "activate": { + "description": "Activates a base plan. Once activated, base plans will be available to new subscribers.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.activate", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The unique base plan ID of the base plan to activate.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the base plan to activate.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the base plan to activate.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", + "request": { + "$ref": "ActivateBasePlanRequest" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "deactivate": { + "description": "Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.deactivate", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The unique base plan ID of the base plan to deactivate.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the base plan to deactivate.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the base plan to deactivate.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + "request": { + "$ref": "DeactivateBasePlanRequest" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "delete": { + "description": "Deletes a base plan. Can only be done for draft base plans. This action is irreversible.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", + "httpMethod": "DELETE", + "id": "androidpublisher.monetization.subscriptions.basePlans.delete", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The unique offer ID of the base plan to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the base plan to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the base plan to delete.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "migratePrices": { + "description": "Migrates subscribers who are receiving an historical subscription price to the currently-offered price for the specified region. Requests will cause price change notifications to be sent to users who are currently receiving an historical price older than the supplied timestamp. Subscribers who do not agree to the new price will have their subscription ended at the next renewal.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.migratePrices", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The unique base plan ID of the base plan to update prices on.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", + "request": { + "$ref": "MigrateBasePlanPricesRequest" + }, + "response": { + "$ref": "MigrateBasePlanPricesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + }, + "resources": { + "offers": { + "methods": { + "activate": { + "description": "Activates a subscription offer. Once activated, subscription offers will be available to new subscribers.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.activate", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId", + "offerId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to activate.", + "location": "path", + "required": true, + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to activate.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to activate.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to activate.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", + "request": { + "$ref": "ActivateSubscriptionOfferRequest" + }, + "response": { + "$ref": "SubscriptionOffer" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "create": { + "description": "Creates a new subscription offer. Only auto-renewing base plans can have subscription offers. The offer state will be DRAFT until it is activated.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.create", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) for which the offer should be created. Must be equal to the base_plan_id field on the SubscriptionOffer resource.", + "location": "path", + "required": true, + "type": "string" + }, + "offerId": { + "description": "Required. The ID to use for the offer. For the requirements on this format, see the documentation of the offer_id field on the SubscriptionOffer resource.", + "location": "query", + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) for which the offer should be created. Must be equal to the package_name field on the Subscription resource.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) for which the offer should be created. Must be equal to the product_id field on the SubscriptionOffer resource.", + "location": "path", + "required": true, + "type": "string" + }, + "regionsVersion.version": { + "description": "Required. A string representing version of the available regions being used for the specified resource.", + "location": "query", + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + "request": { + "$ref": "SubscriptionOffer" + }, + "response": { + "$ref": "SubscriptionOffer" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "deactivate": { + "description": "Deactivates a subscription offer. Once deactivated, existing subscribers will maintain their subscription, but the offer will become unavailable to new subscribers.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate", + "httpMethod": "POST", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.deactivate", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId", + "offerId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to deactivate.", + "location": "path", + "required": true, + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to deactivate.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to deactivate.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to deactivate.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate", + "request": { + "$ref": "DeactivateSubscriptionOfferRequest" + }, + "response": { + "$ref": "SubscriptionOffer" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "delete": { + "description": "Deletes a subscription offer. Can only be done for draft offers. This action is irreversible.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + "httpMethod": "DELETE", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.delete", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId", + "offerId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to delete.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to delete.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "description": "Reads a single offer", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + "httpMethod": "GET", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.get", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId", + "offerId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) of the offer to get.", + "location": "path", + "required": true, + "type": "string" + }, + "offerId": { + "description": "Required. The unique offer ID of the offer to get.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) of the offer to get.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) of the offer to get.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + "response": { + "$ref": "SubscriptionOffer" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "description": "Lists all offers under a given subscription.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + "httpMethod": "GET", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.list", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId" + ], + "parameters": { + "basePlanId": { + "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. The parent app (package name) for which the subscriptions should be read.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The maximum number of subscriptions to return. The service may return fewer than this value. If unspecified, at most 50 subscriptions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListSubscriptionsOffers` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptionOffers` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "productId": { + "description": "Required. The parent subscription (ID) for which the offers should be read.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + "response": { + "$ref": "ListSubscriptionOffersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "description": "Updates an existing subscription offer.", + "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + "httpMethod": "PATCH", + "id": "androidpublisher.monetization.subscriptions.basePlans.offers.patch", + "parameterOrder": [ + "packageName", + "productId", + "basePlanId", + "offerId" + ], + "parameters": { + "basePlanId": { + "description": "Required. Immutable. The ID of the base plan to which this offer is an extension.", + "location": "path", + "required": true, + "type": "string" + }, + "offerId": { + "description": "Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan.", + "location": "path", + "required": true, + "type": "string" + }, + "packageName": { + "description": "Required. Immutable. The package name of the app the parent subscription belongs to.", + "location": "path", + "required": true, + "type": "string" + }, + "productId": { + "description": "Required. Immutable. The ID of the parent subscription this offer belongs to.", + "location": "path", + "required": true, + "type": "string" + }, + "regionsVersion.version": { + "description": "Required. A string representing version of the available regions being used for the specified resource.", + "location": "query", + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + "request": { + "$ref": "SubscriptionOffer" + }, + "response": { + "$ref": "SubscriptionOffer" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + } + } + } + } + } } }, "orders": { @@ -2683,6 +3416,41 @@ } } }, + "subscriptionsv2": { + "methods": { + "get": { + "description": "Get metadata about a subscription", + "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}", + "httpMethod": "GET", + "id": "androidpublisher.purchases.subscriptionsv2.get", + "parameterOrder": [ + "packageName", + "token" + ], + "parameters": { + "packageName": { + "description": "The package of the application for which this subscription was purchased (for example, 'com.some.thing').", + "location": "path", + "required": true, + "type": "string" + }, + "token": { + "description": "Required. The token provided to the user's device when the subscription was purchased.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}", + "response": { + "$ref": "SubscriptionPurchaseV2" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, "voidedpurchases": { "methods": { "list": { @@ -3147,9 +3915,32 @@ } } }, - "revision": "20220503", + "revision": "20220511", "rootUrl": "https://androidpublisher.googleapis.com/", "schemas": { + "AcquisitionTargetingRule": { + "description": "Represents a targeting rule of the form: User never had {scope} before.", + "id": "AcquisitionTargetingRule", + "properties": { + "scope": { + "$ref": "TargetingRuleScope", + "description": "Required. The scope of subscriptions this rule considers. Only allows \"this subscription\" and \"any subscription in app\"." + } + }, + "type": "object" + }, + "ActivateBasePlanRequest": { + "description": "Request message for ActivateBasePlan.", + "id": "ActivateBasePlanRequest", + "properties": {}, + "type": "object" + }, + "ActivateSubscriptionOfferRequest": { + "description": "Request message for ActivateSubscriptionOffer.", + "id": "ActivateSubscriptionOfferRequest", + "properties": {}, + "type": "object" + }, "Apk": { "description": "Information about an APK. The resource for ApksService.", "id": "Apk", @@ -3261,35 +4052,153 @@ }, "type": "object" }, - "Bundle": { - "description": "Information about an app bundle. The resource for BundlesService.", - "id": "Bundle", + "ArchiveSubscriptionRequest": { + "description": "Request message for ArchiveSubscription.", + "id": "ArchiveSubscriptionRequest", + "properties": {}, + "type": "object" + }, + "AutoRenewingBasePlanType": { + "description": "Represents a base plan that automatically renews at the end of its subscription period.", + "id": "AutoRenewingBasePlanType", "properties": { - "sha1": { - "description": "A sha1 hash of the upload payload, encoded as a hex string and matching the output of the sha1sum command.", + "billingPeriodDuration": { + "description": "Required. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center.", "type": "string" }, - "sha256": { - "description": "A sha256 hash of the upload payload, encoded as a hex string and matching the output of the sha256sum command.", + "gracePeriodDuration": { + "description": "Grace period of the subscription, specified in ISO 8601 format. Acceptable values are P0D (zero days), P3D (3 days), P7D (7 days), P14D (14 days), and P30D (30 days). If not specified, a default value will be used based on the recurring period duration.", "type": "string" }, - "versionCode": { - "description": "The version code of the Android App Bundle, as specified in the Android App Bundle's base module APK manifest file.", - "format": "int32", - "type": "integer" + "legacyCompatible": { + "description": "Whether the renewing base plan is compatible with legacy version of the Play Billing Library (prior to version 3) or not. Only one renewing base plan can be marked as legacy compatible for a given subscription.", + "type": "boolean" + }, + "prorationMode": { + "description": "The proration mode for the base plan determines what happens when a user switches to this plan from another base plan. If unspecified, defaults to CHARGE_ON_NEXT_BILLING_DATE.", + "enum": [ + "SUBSCRIPTION_PRORATION_MODE_UNSPECIFIED", + "SUBSCRIPTION_PRORATION_MODE_CHARGE_ON_NEXT_BILLING_DATE", + "SUBSCRIPTION_PRORATION_MODE_CHARGE_FULL_PRICE_IMMEDIATELY" + ], + "enumDescriptions": [ + "Unspecified mode.", + "Users will be charged for their new base plan at the end of their current billing period.", + "Users will be charged for their new base plan immediately and in full. Any remaining period of their existing subscription will be used to extend the duration of the new billing plan." + ], + "type": "string" + }, + "resubscribeState": { + "description": "Whether users should be able to resubscribe to this base plan in Google Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified.", + "enum": [ + "RESUBSCRIBE_STATE_UNSPECIFIED", + "RESUBSCRIBE_STATE_ACTIVE", + "RESUBSCRIBE_STATE_INACTIVE" + ], + "enumDescriptions": [ + "Unspecified state.", + "Resubscribe is active.", + "Resubscribe is inactive." + ], + "type": "string" } }, "type": "object" }, - "BundlesListResponse": { - "description": "Response listing all app bundles.", - "id": "BundlesListResponse", + "AutoRenewingPlan": { + "description": "Information related to an auto renewing plan.", + "id": "AutoRenewingPlan", "properties": { - "bundles": { - "description": "All app bundles.", - "items": { - "$ref": "Bundle" - }, + "autoRenewEnabled": { + "description": "If the subscription is currently set to auto-renew, e.g. the user has not canceled the subscription", + "type": "boolean" + } + }, + "type": "object" + }, + "BasePlan": { + "description": "A single base plan for a subscription.", + "id": "BasePlan", + "properties": { + "autoRenewingBasePlanType": { + "$ref": "AutoRenewingBasePlanType", + "description": "Set when the base plan automatically renews at a regular interval." + }, + "basePlanId": { + "description": "Required. Immutable. The unique identifier of this base plan. Must be unique within the subscription, and conform with RFC-1034. That is, this ID can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 63 characters.", + "type": "string" + }, + "offerTags": { + "description": "List of up to 20 custom tags specified for this base plan, and returned to the app through the billing library. Subscription offers for this base plan will also receive these offer tags in the billing library.", + "items": { + "$ref": "OfferTag" + }, + "type": "array" + }, + "otherRegionsConfig": { + "$ref": "OtherRegionsBasePlanConfig", + "description": "Pricing information for any new locations Play may launch in the future. If omitted, the BasePlan will not be automatically available any new locations Play may launch in the future." + }, + "prepaidBasePlanType": { + "$ref": "PrepaidBasePlanType", + "description": "Set when the base plan does not automatically renew at the end of the billing period." + }, + "regionalConfigs": { + "description": "Region-specific information for this base plan.", + "items": { + "$ref": "RegionalBasePlanConfig" + }, + "type": "array" + }, + "state": { + "description": "Output only. The state of the base plan, i.e. whether it's active. Draft and inactive base plans can be activated or deleted. Active base plans can be made inactive. Inactive base plans can be canceled. This field cannot be changed by updating the resource. Use the dedicated endpoints instead.", + "enum": [ + "STATE_UNSPECIFIED", + "DRAFT", + "ACTIVE", + "INACTIVE" + ], + "enumDescriptions": [ + "Unspecified state.", + "The base plan is currently in a draft state, and hasn't been activated. It can be safely deleted at this point.", + "The base plan is active and available for new subscribers.", + "The base plan is inactive and only available for existing subscribers." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "Bundle": { + "description": "Information about an app bundle. The resource for BundlesService.", + "id": "Bundle", + "properties": { + "sha1": { + "description": "A sha1 hash of the upload payload, encoded as a hex string and matching the output of the sha1sum command.", + "type": "string" + }, + "sha256": { + "description": "A sha256 hash of the upload payload, encoded as a hex string and matching the output of the sha256sum command.", + "type": "string" + }, + "versionCode": { + "description": "The version code of the Android App Bundle, as specified in the Android App Bundle's base module APK manifest file.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "BundlesListResponse": { + "description": "Response listing all app bundles.", + "id": "BundlesListResponse", + "properties": { + "bundles": { + "description": "All app bundles.", + "items": { + "$ref": "Bundle" + }, "type": "array" }, "kind": { @@ -3299,6 +4208,60 @@ }, "type": "object" }, + "CancelSurveyResult": { + "description": "Result of the cancel survey when the subscription was canceled by the user.", + "id": "CancelSurveyResult", + "properties": { + "reason": { + "description": "The reason the user selected in the cancel survey.", + "enum": [ + "CANCEL_SURVEY_REASON_UNSPECIFIED", + "CANCEL_SURVEY_REASON_NOT_ENOUGH_USAGE", + "CANCEL_SURVEY_REASON_TECHNICAL_ISSUES", + "CANCEL_SURVEY_REASON_COST_RELATED", + "CANCEL_SURVEY_REASON_FOUND_BETTER_APP", + "CANCEL_SURVEY_REASON_OTHERS" + ], + "enumDescriptions": [ + "Unspecified cancel survey reason.", + "Not enough usage of the subscription.", + "Technical issues while using the app.", + "Cost related issues.", + "The user found a better app.", + "Other reasons." + ], + "type": "string" + }, + "reasonUserInput": { + "description": "Only set for CANCEL_SURVEY_REASON_OTHERS. This is the user's freeform response to the survey.", + "type": "string" + } + }, + "type": "object" + }, + "CanceledStateContext": { + "description": "Information specific to a subscription in canceled state.", + "id": "CanceledStateContext", + "properties": { + "developerInitiatedCancellation": { + "$ref": "DeveloperInitiatedCancellation", + "description": "Subscription was canceled by the developer." + }, + "replacementCancellation": { + "$ref": "ReplacementCancellation", + "description": "Subscription was replaced by a new subscription." + }, + "systemInitiatedCancellation": { + "$ref": "SystemInitiatedCancellation", + "description": "Subscription was canceled by the system, for example because of a billing problem." + }, + "userInitiatedCancellation": { + "$ref": "UserInitiatedCancellation", + "description": "Subscription was canceled by user." + } + }, + "type": "object" + }, "Comment": { "description": "An entry of conversation between user and developer.", "id": "Comment", @@ -3395,6 +4358,18 @@ }, "type": "object" }, + "DeactivateBasePlanRequest": { + "description": "Request message for DeactivateBasePlan.", + "id": "DeactivateBasePlanRequest", + "properties": {}, + "type": "object" + }, + "DeactivateSubscriptionOfferRequest": { + "description": "Request message for DeactivateSubscriptionOffer.", + "id": "DeactivateSubscriptionOfferRequest", + "properties": {}, + "type": "object" + }, "DeobfuscationFile": { "description": "Represents a deobfuscation file.", "id": "DeobfuscationFile", @@ -3442,6 +4417,12 @@ }, "type": "object" }, + "DeveloperInitiatedCancellation": { + "description": "Information specific to cancellations initiated by developers.", + "id": "DeveloperInitiatedCancellation", + "properties": {}, + "type": "object" + }, "DeviceGroup": { "description": "LINT.IfChange A group of devices. A group is defined by a set of device selectors. A device belongs to the group if it matches any selector (logical OR).", "id": "DeviceGroup", @@ -3698,6 +4679,25 @@ }, "type": "object" }, + "ExternalAccountIdentifiers": { + "description": "User account identifier in the third-party service.", + "id": "ExternalAccountIdentifiers", + "properties": { + "externalAccountId": { + "description": "User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.", + "type": "string" + }, + "obfuscatedExternalAccountId": { + "description": "An obfuscated version of the id that is uniquely associated with the user's account in your app. Present for the following purchases: * If account linking happened as part of the subscription purchase flow. * It was specified using https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid when the purchase was made.", + "type": "string" + }, + "obfuscatedExternalProfileId": { + "description": "An obfuscated version of the id that is uniquely associated with the user's profile in your app. Only present if specified using https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid when the purchase was made.", + "type": "string" + } + }, + "type": "object" + }, "ExternallyHostedApk": { "description": "Defines an APK available for this application that is hosted externally and not uploaded to Google Play. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.", "id": "ExternallyHostedApk", @@ -4211,6 +5211,42 @@ }, "type": "object" }, + "ListSubscriptionOffersResponse": { + "description": "Response message for ListSubscriptionOffers.", + "id": "ListSubscriptionOffersResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "subscriptionOffers": { + "description": "The subscription offers from the specified subscription.", + "items": { + "$ref": "SubscriptionOffer" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListSubscriptionsResponse": { + "description": "Response message for ListSubscriptions.", + "id": "ListSubscriptionsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "subscriptions": { + "description": "The subscriptions from the specified app.", + "items": { + "$ref": "Subscription" + }, + "type": "array" + } + }, + "type": "object" + }, "ListUsersResponse": { "description": "A response containing one or more users with access to an account.", "id": "ListUsersResponse", @@ -4317,6 +5353,30 @@ }, "type": "object" }, + "MigrateBasePlanPricesRequest": { + "description": "Request message for MigrateBasePlanPrices.", + "id": "MigrateBasePlanPricesRequest", + "properties": { + "regionalPriceMigrations": { + "description": "Required. The regional prices to update.", + "items": { + "$ref": "RegionalPriceMigrationConfig" + }, + "type": "array" + }, + "regionsVersion": { + "$ref": "RegionsVersion", + "description": "Required. The version of the available regions being used for the regional_price_migrations." + } + }, + "type": "object" + }, + "MigrateBasePlanPricesResponse": { + "description": "Response message for MigrateBasePlanPrices.", + "id": "MigrateBasePlanPricesResponse", + "properties": {}, + "type": "object" + }, "Money": { "description": "Represents an amount of money with its currency type.", "id": "Money", @@ -4338,6 +5398,82 @@ }, "type": "object" }, + "OfferTag": { + "description": "Represents a custom tag specified for base plans and subscription offers.", + "id": "OfferTag", + "properties": { + "tag": { + "description": "Must conform with RFC-1034. That is, this string can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 20 characters.", + "type": "string" + } + }, + "type": "object" + }, + "OtherRegionsBasePlanConfig": { + "description": "Pricing information for any new locations Play may launch in.", + "id": "OtherRegionsBasePlanConfig", + "properties": { + "eurPrice": { + "$ref": "Money", + "description": "Required. Price in EUR to use for any new locations Play may launch in." + }, + "newSubscriberAvailability": { + "description": "Whether the base plan is available for new subscribers in any new locations Play may launch in. If not specified, this will default to false.", + "type": "boolean" + }, + "usdPrice": { + "$ref": "Money", + "description": "Required. Price in USD to use for any new locations Play may launch in." + } + }, + "type": "object" + }, + "OtherRegionsSubscriptionOfferConfig": { + "description": "Configuration for any new locations Play may launch in specified on a subscription offer.", + "id": "OtherRegionsSubscriptionOfferConfig", + "properties": { + "otherRegionsNewSubscriberAvailability": { + "description": "Whether the subscription offer in any new locations Play may launch in the future. If not specified, this will default to false.", + "type": "boolean" + } + }, + "type": "object" + }, + "OtherRegionsSubscriptionOfferPhaseConfig": { + "description": "Configuration for any new locations Play may launch in for a single offer phase.", + "id": "OtherRegionsSubscriptionOfferPhaseConfig", + "properties": { + "absoluteDiscounts": { + "$ref": "OtherRegionsSubscriptionOfferPhasePrices", + "description": "The absolute amount of money subtracted from the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a $1 absolute discount for a phase of a duration of 3 months would correspond to a price of $2. The resulting price may not be smaller than the minimum price allowed for any new locations Play may launch in." + }, + "otherRegionsPrices": { + "$ref": "OtherRegionsSubscriptionOfferPhasePrices", + "description": "The absolute price the user pays for this offer phase. The price must not be smaller than the minimum price allowed for any new locations Play may launch in." + }, + "relativeDiscount": { + "description": "The fraction of the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a 50% discount for a phase of a duration of 3 months would correspond to a price of $1.50. The discount must be specified as a fraction strictly larger than 0 and strictly smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents for USD). The relative discount is considered invalid if the discounted price ends up being smaller than the minimum price allowed in any new locations Play may launch in.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "OtherRegionsSubscriptionOfferPhasePrices": { + "description": "Pricing information for any new locations Play may launch in.", + "id": "OtherRegionsSubscriptionOfferPhasePrices", + "properties": { + "eurPrice": { + "$ref": "Money", + "description": "Required. Price in EUR to use for any new locations Play may launch in." + }, + "usdPrice": { + "$ref": "Money", + "description": "Required. Price in USD to use for any new locations Play may launch in." + } + }, + "type": "object" + }, "PageInfo": { "description": "Information about the current page. List operations that supports paging return only one \"page\" of results. This protocol buffer message describes the page that has been returned.", "id": "PageInfo", @@ -4360,6 +5496,55 @@ }, "type": "object" }, + "PausedStateContext": { + "description": "Information specific to a subscription in paused state.", + "id": "PausedStateContext", + "properties": { + "autoResumeTime": { + "description": "Time at which the subscription will be automatically resumed.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "PrepaidBasePlanType": { + "description": "Represents a base plan that does not automatically renew at the end of the base plan, and must be manually renewed by the user.", + "id": "PrepaidBasePlanType", + "properties": { + "billingPeriodDuration": { + "description": "Required. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center.", + "type": "string" + }, + "timeExtension": { + "description": "Whether users should be able to extend this prepaid base plan in Google Play surfaces. Defaults to TIME_EXTENSION_ACTIVE if not specified.", + "enum": [ + "TIME_EXTENSION_UNSPECIFIED", + "TIME_EXTENSION_ACTIVE", + "TIME_EXTENSION_INACTIVE" + ], + "enumDescriptions": [ + "Unspecified state.", + "Time extension is active. Users are allowed to top-up or extend their prepaid plan.", + "Time extension is inactive. Users cannot top-up or extend their prepaid plan." + ], + "type": "string" + } + }, + "type": "object" + }, + "PrepaidPlan": { + "description": "Information related to a prepaid plan.", + "id": "PrepaidPlan", + "properties": { + "allowExtendAfterTime": { + "description": "After this time, the subscription is allowed for a new top-up purchase. Not present if the subscription is already extended by a top-up purchase.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "Price": { "description": "Definition of a price, i.e. currency and units.", "id": "Price", @@ -4455,6 +5640,80 @@ }, "type": "object" }, + "RegionalBasePlanConfig": { + "description": "Configuration for a base plan specific to a region.", + "id": "RegionalBasePlanConfig", + "properties": { + "newSubscriberAvailability": { + "description": "Whether the base plan in the specified region is available for new subscribers. Existing subscribers will not have their subscription canceled if this value is set to false. If not specified, this will default to false.", + "type": "boolean" + }, + "price": { + "$ref": "Money", + "description": "The price of the base plan in the specified region. Must be set if the base plan is available to new subscribers. Must be set in the currency that is linked to the specified region." + }, + "regionCode": { + "description": "Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g. \"US\".", + "type": "string" + } + }, + "type": "object" + }, + "RegionalPriceMigrationConfig": { + "description": "Configuration for a price migration.", + "id": "RegionalPriceMigrationConfig", + "properties": { + "oldestAllowedPriceVersionTime": { + "description": "Required. The cutoff time for historical prices that subscribers can remain paying. Subscribers who are on a price that was created before this cutoff time will be migrated to the currently-offered price. These subscribers will receive a notification that they will be paying a different price. Subscribers who do not agree to the new price will have their subscription ended at the next renewal.", + "format": "google-datetime", + "type": "string" + }, + "regionCode": { + "description": "Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g. \"US\".", + "type": "string" + } + }, + "type": "object" + }, + "RegionalSubscriptionOfferConfig": { + "description": "Configuration for a subscription offer in a single region.", + "id": "RegionalSubscriptionOfferConfig", + "properties": { + "newSubscriberAvailability": { + "description": "Whether the subscription offer in the specified region is available for new subscribers. Existing subscribers will not have their subscription cancelled if this value is set to false. If not specified, this will default to false.", + "type": "boolean" + }, + "regionCode": { + "description": "Required. Immutable. Region code this configuration applies to, as defined by ISO 3166-2, e.g. \"US\".", + "type": "string" + } + }, + "type": "object" + }, + "RegionalSubscriptionOfferPhaseConfig": { + "description": "Configuration for a single phase of a subscription offer in a single region.", + "id": "RegionalSubscriptionOfferPhaseConfig", + "properties": { + "absoluteDiscount": { + "$ref": "Money", + "description": "The absolute amount of money subtracted from the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a $1 absolute discount for a phase of a duration of 3 months would correspond to a price of $2. The resulting price may not be smaller than the minimum price allowed for this region." + }, + "price": { + "$ref": "Money", + "description": "The absolute price the user pays for this offer phase. The price must not be smaller than the minimum price allowed for this region." + }, + "regionCode": { + "description": "Required. Immutable. The region to which this config applies.", + "type": "string" + }, + "relativeDiscount": { + "description": "The fraction of the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a 50% discount for a phase of a duration of 3 months would correspond to a price of $1.50. The discount must be specified as a fraction strictly larger than 0 and strictly smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents for USD). The relative discount is considered invalid if the discounted price ends up being smaller than the minimum price allowed in this region.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, "RegionalTaxRateInfo": { "description": "Specified details about taxation in a given geographical region.", "id": "RegionalTaxRateInfo", @@ -4486,6 +5745,23 @@ }, "type": "object" }, + "RegionsVersion": { + "description": "The version of the available regions being used for the specified resource.", + "id": "RegionsVersion", + "properties": { + "version": { + "description": "Required. A string representing version of the available regions being used for the specified resource.", + "type": "string" + } + }, + "type": "object" + }, + "ReplacementCancellation": { + "description": "Information specific to cancellations caused by subscription replacement.", + "id": "ReplacementCancellation", + "properties": {}, + "type": "object" + }, "Review": { "description": "An Android app review.", "id": "Review", @@ -4567,6 +5843,71 @@ }, "type": "object" }, + "SubscribeWithGoogleInfo": { + "description": "Information associated with purchases made with 'Subscribe with Google'.", + "id": "SubscribeWithGoogleInfo", + "properties": { + "emailAddress": { + "description": "The email address of the user when the subscription was purchased.", + "type": "string" + }, + "familyName": { + "description": "The family name of the user when the subscription was purchased.", + "type": "string" + }, + "givenName": { + "description": "The given name of the user when the subscription was purchased.", + "type": "string" + }, + "profileId": { + "description": "The Google profile id of the user when the subscription was purchased.", + "type": "string" + }, + "profileName": { + "description": "The profile name of the user when the subscription was purchased.", + "type": "string" + } + }, + "type": "object" + }, + "Subscription": { + "description": "A single subscription for an app.", + "id": "Subscription", + "properties": { + "archived": { + "description": "Output only. Whether this subscription is archived. Archived subscriptions are not available to any subscriber any longer, cannot be updated, and are not returned in list requests unless the show archived flag is passed in.", + "readOnly": true, + "type": "boolean" + }, + "basePlans": { + "description": "The set of base plans for this subscription. Represents the prices and duration of the subscription if no other offers apply.", + "items": { + "$ref": "BasePlan" + }, + "type": "array" + }, + "listings": { + "description": "Required. List of localized listings for this subscription. Must contain at least an entry for the default language of the parent app.", + "items": { + "$ref": "SubscriptionListing" + }, + "type": "array" + }, + "packageName": { + "description": "Immutable. Package name of the parent app.", + "type": "string" + }, + "productId": { + "description": "Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length.", + "type": "string" + }, + "taxAndComplianceSettings": { + "$ref": "SubscriptionTaxAndComplianceSettings", + "description": "Details about taxes and legal compliance." + } + }, + "type": "object" + }, "SubscriptionCancelSurveyResult": { "description": "Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).", "id": "SubscriptionCancelSurveyResult", @@ -4600,6 +5941,143 @@ }, "type": "object" }, + "SubscriptionListing": { + "description": "The consumer-visible metadata of a subscription.", + "id": "SubscriptionListing", + "properties": { + "benefits": { + "description": "A list of benefits shown to the user on platforms such as the Play Store and in restoration flows in the language of this listing. Plain text. Ordered list of at most four benefits.", + "items": { + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "The description of this subscription in the language of this listing. Maximum length - 80 characters. Plain text.", + "type": "string" + }, + "languageCode": { + "description": "Required. The language of this listing, as defined by BCP-47, e.g. \"en-US\".", + "type": "string" + }, + "title": { + "description": "Required. The title of this subscription in the language of this listing. Plain text.", + "type": "string" + } + }, + "type": "object" + }, + "SubscriptionOffer": { + "description": "A single, temporary offer", + "id": "SubscriptionOffer", + "properties": { + "basePlanId": { + "description": "Required. Immutable. The ID of the base plan to which this offer is an extension.", + "type": "string" + }, + "offerId": { + "description": "Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan.", + "type": "string" + }, + "offerTags": { + "description": "List of up to 20 custom tags specified for this offer, and returned to the app through the billing library.", + "items": { + "$ref": "OfferTag" + }, + "type": "array" + }, + "otherRegionsConfig": { + "$ref": "OtherRegionsSubscriptionOfferConfig", + "description": "The configuration for any new locations Play may launch in the future." + }, + "packageName": { + "description": "Required. Immutable. The package name of the app the parent subscription belongs to.", + "type": "string" + }, + "phases": { + "description": "Required. The phases of this subscription offer. Must contain at least one entry, and may contain at most five. Users will always receive all these phases in the specified order. Phases may not be added, removed, or reordered after initial creation.", + "items": { + "$ref": "SubscriptionOfferPhase" + }, + "type": "array" + }, + "productId": { + "description": "Required. Immutable. The ID of the parent subscription this offer belongs to.", + "type": "string" + }, + "regionalConfigs": { + "description": "Required. The region-specific configuration of this offer. Must contain at least one entry.", + "items": { + "$ref": "RegionalSubscriptionOfferConfig" + }, + "type": "array" + }, + "state": { + "description": "Output only. The current state of this offer. Can be changed using Activate and Deactivate actions. NB: the base plan state supersedes this state, so an active offer may not be available if the base plan is not active.", + "enum": [ + "STATE_UNSPECIFIED", + "DRAFT", + "ACTIVE", + "INACTIVE" + ], + "enumDescriptions": [ + "Default value, should never be used.", + "The subscription offer is not and has never been available to users.", + "The subscription offer is available to new and existing users.", + "The subscription offer is not available to new users. Existing users retain access." + ], + "readOnly": true, + "type": "string" + }, + "targeting": { + "$ref": "SubscriptionOfferTargeting", + "description": "The requirements that users need to fulfil to be eligible for this offer. Represents the requirements that Play will evaluate to decide whether an offer should be returned. Developers may further filter these offers themselves." + } + }, + "type": "object" + }, + "SubscriptionOfferPhase": { + "description": "A single phase of a subscription offer.", + "id": "SubscriptionOfferPhase", + "properties": { + "duration": { + "description": "Required. The duration of a single recurrence of this phase. Specified in ISO 8601 format.", + "type": "string" + }, + "otherRegionsConfig": { + "$ref": "OtherRegionsSubscriptionOfferPhaseConfig", + "description": "Pricing information for any new locations Play may launch in." + }, + "recurrenceCount": { + "description": "Required. The number of times this phase repeats. If this offer phase is not free, each recurrence charges the user the price of this offer phase.", + "format": "int32", + "type": "integer" + }, + "regionalConfigs": { + "description": "Required. The region-specific configuration of this offer phase. This list must contain exactly one entry for each region for which the subscription offer has a regional config.", + "items": { + "$ref": "RegionalSubscriptionOfferPhaseConfig" + }, + "type": "array" + } + }, + "type": "object" + }, + "SubscriptionOfferTargeting": { + "description": "Defines the rule a user needs to satisfy to receive this offer.", + "id": "SubscriptionOfferTargeting", + "properties": { + "acquisitionRule": { + "$ref": "AcquisitionTargetingRule", + "description": "Offer targeting rule for new user acquisition." + }, + "upgradeRule": { + "$ref": "UpgradeTargetingRule", + "description": "Offer targeting rule for upgrading users' existing plans." + } + }, + "type": "object" + }, "SubscriptionPriceChange": { "description": "Contains the price change information for a subscription that can be used to control the user journey for the price change in the app. This can be in the form of seeking confirmation from the user or tailoring the experience for a successful conversion.", "id": "SubscriptionPriceChange", @@ -4749,6 +6227,123 @@ }, "type": "object" }, + "SubscriptionPurchaseLineItem": { + "description": "Item-level info for a subscription purchase.", + "id": "SubscriptionPurchaseLineItem", + "properties": { + "autoRenewingPlan": { + "$ref": "AutoRenewingPlan", + "description": "The item is auto renewing." + }, + "expiryTime": { + "description": "Time at which the subscription expired or will expire unless the access is extended (ex. renews).", + "format": "google-datetime", + "type": "string" + }, + "prepaidPlan": { + "$ref": "PrepaidPlan", + "description": "The item is prepaid." + }, + "productId": { + "description": "The purchased product ID (for example, 'monthly001').", + "type": "string" + } + }, + "type": "object" + }, + "SubscriptionPurchaseV2": { + "description": "Indicates the status of a user's subscription purchase.", + "id": "SubscriptionPurchaseV2", + "properties": { + "acknowledgementState": { + "description": "The acknowledgement state of the subscription.", + "enum": [ + "ACKNOWLEDGEMENT_STATE_UNSPECIFIED", + "ACKNOWLEDGEMENT_STATE_PENDING", + "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED" + ], + "enumDescriptions": [ + "Unspecified acknowledgement state.", + "The subscription is not acknowledged yet.", + "The subscription is acknowledged." + ], + "type": "string" + }, + "canceledStateContext": { + "$ref": "CanceledStateContext", + "description": "Additional context around canceled subscriptions. Only present if the subscription currently has subscription_state SUBSCRIPTION_STATE_CANCELED." + }, + "externalAccountIdentifiers": { + "$ref": "ExternalAccountIdentifiers", + "description": "User account identifier in the third-party service." + }, + "kind": { + "description": "This kind represents a SubscriptionPurchaseV2 object in the androidpublisher service.", + "type": "string" + }, + "latestOrderId": { + "description": "The order id of the latest order associated with the purchase of the subscription. For autoRenewing subscription, this is the order id of signup order if it is not renewed yet, or the last recurring order id (success, pending, or declined order). For prepaid subscription, this is the order id associated with the queried purchase token.", + "type": "string" + }, + "lineItems": { + "description": "Item-level info for a subscription purchase. The items in the same purchase should be either all with AutoRenewingPlan or all with PrepaidPlan.", + "items": { + "$ref": "SubscriptionPurchaseLineItem" + }, + "type": "array" + }, + "linkedPurchaseToken": { + "description": "The purchase token of the old subscription if this subscription is one of the following: * Re-signup of a canceled but non-lapsed subscription * Upgrade/downgrade from a previous subscription. * Convert from prepaid to auto renewing subscription. * Convert from an auto renewing subscription to prepaid. * Topup a prepaid subscription.", + "type": "string" + }, + "pausedStateContext": { + "$ref": "PausedStateContext", + "description": "Additional context around paused subscriptions. Only present if the subscription currently has subscription_state SUBSCRIPTION_STATE_PAUSED." + }, + "regionCode": { + "description": "ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.", + "type": "string" + }, + "startTime": { + "description": "Time at which the subscription was granted. Not set for pending subscriptions (subscription was created but awaiting payment during signup).", + "format": "google-datetime", + "type": "string" + }, + "subscribeWithGoogleInfo": { + "$ref": "SubscribeWithGoogleInfo", + "description": "User profile associated with purchases made with 'Subscribe with Google'." + }, + "subscriptionState": { + "description": "The current state of the subscription.", + "enum": [ + "SUBSCRIPTION_STATE_UNSPECIFIED", + "SUBSCRIPTION_STATE_PENDING", + "SUBSCRIPTION_STATE_ACTIVE", + "SUBSCRIPTION_STATE_PAUSED", + "SUBSCRIPTION_STATE_IN_GRACE_PERIOD", + "SUBSCRIPTION_STATE_ON_HOLD", + "SUBSCRIPTION_STATE_CANCELED", + "SUBSCRIPTION_STATE_EXPIRED" + ], + "enumDescriptions": [ + "Unspecified subscription state.", + "Subscription was created but awaiting payment during signup. In this state, all items are awaiting payment.", + "Subscription is active. - (1) If the subscription is an auto renewing plan, at least one item is auto_renew_enabled and not expired. - (2) If the subscription is a prepaid plan, at least one item is not expired.", + "Subscription is paused. The state is only available when the subscription is an auto renewing plan. In this state, all items are in paused state.", + "Subscription is in grace period. The state is only available when the subscription is an auto renewing plan. In this state, all items are in grace period.", + "Subscription is on hold (suspended). The state is only available when the subscription is an auto renewing plan. In this state, all items are on hold.", + "Subscription is canceled but not expired yet. The state is only available when the subscription is an auto renewing plan. All items have auto_renew_enabled set to false.", + "Subscription is expired. All items have expiry_time in the past." + ], + "type": "string" + }, + "testPurchase": { + "$ref": "TestPurchase", + "description": "Only present if this subscription purchase is a test purchase." + } + }, + "type": "object" + }, "SubscriptionPurchasesAcknowledgeRequest": { "description": "Request for the purchases.subscriptions.acknowledge API.", "id": "SubscriptionPurchasesAcknowledgeRequest", @@ -4836,6 +6431,29 @@ }, "type": "object" }, + "SystemInitiatedCancellation": { + "description": "Information specific to cancellations initiated by Google system.", + "id": "SystemInitiatedCancellation", + "properties": {}, + "type": "object" + }, + "TargetingRuleScope": { + "description": "Defines the scope of subscriptions which a targeting rule can match to target offers to users based on past or current entitlement.", + "id": "TargetingRuleScope", + "properties": { + "specificSubscriptionInApp": { + "description": "The scope of the current targeting rule is the subscription with the specified subscription ID. Must be a subscription within the same parent app.", + "type": "string" + } + }, + "type": "object" + }, + "TestPurchase": { + "description": "Whether this subscription purchase is a test purchase.", + "id": "TestPurchase", + "properties": {}, + "type": "object" + }, "Testers": { "description": "The testers of an app. The resource for TestersService. Note: while it is possible in the Play Console UI to add testers via email lists, email lists are not supported by this resource.", "id": "Testers", @@ -5008,6 +6626,25 @@ }, "type": "object" }, + "UpgradeTargetingRule": { + "description": "Represents a targeting rule of the form: User currently has {scope} [with billing period {billing_period}].", + "id": "UpgradeTargetingRule", + "properties": { + "billingPeriodDuration": { + "description": "The specific billing period duration, specified in ISO 8601 format, that a user must be currently subscribed to to be eligible for this rule. If not specified, users subscribed to any billing period are matched.", + "type": "string" + }, + "oncePerUser": { + "description": "Limit this offer to only once per user. If set to true, a user can never be eligible for this offer again if they ever subscribed to this offer.", + "type": "boolean" + }, + "scope": { + "$ref": "TargetingRuleScope", + "description": "Required. The scope of subscriptions this rule considers. Only allows \"this subscription\" and \"specific subscription in app\"." + } + }, + "type": "object" + }, "User": { "description": "A user resource.", "id": "User", @@ -5161,6 +6798,22 @@ }, "type": "object" }, + "UserInitiatedCancellation": { + "description": "Information specific to cancellations initiated by users.", + "id": "UserInitiatedCancellation", + "properties": { + "cancelSurveyResult": { + "$ref": "CancelSurveyResult", + "description": "Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey)." + }, + "cancelTime": { + "description": "The time at which the subscription was canceled by the user. The user might still have access to the subscription after this time. Use line_items.expiry_time to determine if a user still has access.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "UsesPermission": { "description": "A permission used by this APK.", "id": "UsesPermission", diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go index 1c86d0e2cbf..80dfa780bb6 100644 --- a/androidpublisher/v3/androidpublisher-gen.go +++ b/androidpublisher/v3/androidpublisher-gen.go @@ -357,11 +357,47 @@ type InternalappsharingartifactsService struct { func NewMonetizationService(s *Service) *MonetizationService { rs := &MonetizationService{s: s} + rs.Subscriptions = NewMonetizationSubscriptionsService(s) return rs } type MonetizationService struct { s *Service + + Subscriptions *MonetizationSubscriptionsService +} + +func NewMonetizationSubscriptionsService(s *Service) *MonetizationSubscriptionsService { + rs := &MonetizationSubscriptionsService{s: s} + rs.BasePlans = NewMonetizationSubscriptionsBasePlansService(s) + return rs +} + +type MonetizationSubscriptionsService struct { + s *Service + + BasePlans *MonetizationSubscriptionsBasePlansService +} + +func NewMonetizationSubscriptionsBasePlansService(s *Service) *MonetizationSubscriptionsBasePlansService { + rs := &MonetizationSubscriptionsBasePlansService{s: s} + rs.Offers = NewMonetizationSubscriptionsBasePlansOffersService(s) + return rs +} + +type MonetizationSubscriptionsBasePlansService struct { + s *Service + + Offers *MonetizationSubscriptionsBasePlansOffersService +} + +func NewMonetizationSubscriptionsBasePlansOffersService(s *Service) *MonetizationSubscriptionsBasePlansOffersService { + rs := &MonetizationSubscriptionsBasePlansOffersService{s: s} + return rs +} + +type MonetizationSubscriptionsBasePlansOffersService struct { + s *Service } func NewOrdersService(s *Service) *OrdersService { @@ -377,6 +413,7 @@ func NewPurchasesService(s *Service) *PurchasesService { rs := &PurchasesService{s: s} rs.Products = NewPurchasesProductsService(s) rs.Subscriptions = NewPurchasesSubscriptionsService(s) + rs.Subscriptionsv2 = NewPurchasesSubscriptionsv2Service(s) rs.Voidedpurchases = NewPurchasesVoidedpurchasesService(s) return rs } @@ -388,6 +425,8 @@ type PurchasesService struct { Subscriptions *PurchasesSubscriptionsService + Subscriptionsv2 *PurchasesSubscriptionsv2Service + Voidedpurchases *PurchasesVoidedpurchasesService } @@ -409,6 +448,15 @@ type PurchasesSubscriptionsService struct { s *Service } +func NewPurchasesSubscriptionsv2Service(s *Service) *PurchasesSubscriptionsv2Service { + rs := &PurchasesSubscriptionsv2Service{s: s} + return rs +} + +type PurchasesSubscriptionsv2Service struct { + s *Service +} + func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService { rs := &PurchasesVoidedpurchasesService{s: s} return rs @@ -457,6 +505,45 @@ type UsersService struct { s *Service } +// AcquisitionTargetingRule: Represents a targeting rule of the form: +// User never had {scope} before. +type AcquisitionTargetingRule struct { + // Scope: Required. The scope of subscriptions this rule considers. Only + // allows "this subscription" and "any subscription in app". + Scope *TargetingRuleScope `json:"scope,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Scope") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Scope") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AcquisitionTargetingRule) MarshalJSON() ([]byte, error) { + type NoMethod AcquisitionTargetingRule + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivateBasePlanRequest: Request message for ActivateBasePlan. +type ActivateBasePlanRequest struct { +} + +// ActivateSubscriptionOfferRequest: Request message for +// ActivateSubscriptionOffer. +type ActivateSubscriptionOfferRequest struct { +} + // Apk: Information about an APK. The resource for ApksService. type Apk struct { // Binary: Information about the binary payload of this APK. @@ -708,6 +795,182 @@ func (s *AppEdit) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ArchiveSubscriptionRequest: Request message for ArchiveSubscription. +type ArchiveSubscriptionRequest struct { +} + +// AutoRenewingBasePlanType: Represents a base plan that automatically +// renews at the end of its subscription period. +type AutoRenewingBasePlanType struct { + // BillingPeriodDuration: Required. Subscription period, specified in + // ISO 8601 format. For a list of acceptable billing periods, refer to + // the help center. + BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` + + // GracePeriodDuration: Grace period of the subscription, specified in + // ISO 8601 format. Acceptable values are P0D (zero days), P3D (3 days), + // P7D (7 days), P14D (14 days), and P30D (30 days). If not specified, a + // default value will be used based on the recurring period duration. + GracePeriodDuration string `json:"gracePeriodDuration,omitempty"` + + // LegacyCompatible: Whether the renewing base plan is compatible with + // legacy version of the Play Billing Library (prior to version 3) or + // not. Only one renewing base plan can be marked as legacy compatible + // for a given subscription. + LegacyCompatible bool `json:"legacyCompatible,omitempty"` + + // ProrationMode: The proration mode for the base plan determines what + // happens when a user switches to this plan from another base plan. If + // unspecified, defaults to CHARGE_ON_NEXT_BILLING_DATE. + // + // Possible values: + // "SUBSCRIPTION_PRORATION_MODE_UNSPECIFIED" - Unspecified mode. + // "SUBSCRIPTION_PRORATION_MODE_CHARGE_ON_NEXT_BILLING_DATE" - Users + // will be charged for their new base plan at the end of their current + // billing period. + // "SUBSCRIPTION_PRORATION_MODE_CHARGE_FULL_PRICE_IMMEDIATELY" - Users + // will be charged for their new base plan immediately and in full. Any + // remaining period of their existing subscription will be used to + // extend the duration of the new billing plan. + ProrationMode string `json:"prorationMode,omitempty"` + + // ResubscribeState: Whether users should be able to resubscribe to this + // base plan in Google Play surfaces. Defaults to + // RESUBSCRIBE_STATE_ACTIVE if not specified. + // + // Possible values: + // "RESUBSCRIBE_STATE_UNSPECIFIED" - Unspecified state. + // "RESUBSCRIBE_STATE_ACTIVE" - Resubscribe is active. + // "RESUBSCRIBE_STATE_INACTIVE" - Resubscribe is inactive. + ResubscribeState string `json:"resubscribeState,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BillingPeriodDuration") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *AutoRenewingBasePlanType) MarshalJSON() ([]byte, error) { + type NoMethod AutoRenewingBasePlanType + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AutoRenewingPlan: Information related to an auto renewing plan. +type AutoRenewingPlan struct { + // AutoRenewEnabled: If the subscription is currently set to auto-renew, + // e.g. the user has not canceled the subscription + AutoRenewEnabled bool `json:"autoRenewEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoRenewEnabled") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AutoRenewEnabled") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *AutoRenewingPlan) MarshalJSON() ([]byte, error) { + type NoMethod AutoRenewingPlan + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// BasePlan: A single base plan for a subscription. +type BasePlan struct { + // AutoRenewingBasePlanType: Set when the base plan automatically renews + // at a regular interval. + AutoRenewingBasePlanType *AutoRenewingBasePlanType `json:"autoRenewingBasePlanType,omitempty"` + + // BasePlanId: Required. Immutable. The unique identifier of this base + // plan. Must be unique within the subscription, and conform with + // RFC-1034. That is, this ID can only contain lower-case letters (a-z), + // numbers (0-9), and hyphens (-), and be at most 63 characters. + BasePlanId string `json:"basePlanId,omitempty"` + + // OfferTags: List of up to 20 custom tags specified for this base plan, + // and returned to the app through the billing library. Subscription + // offers for this base plan will also receive these offer tags in the + // billing library. + OfferTags []*OfferTag `json:"offerTags,omitempty"` + + // OtherRegionsConfig: Pricing information for any new locations Play + // may launch in the future. If omitted, the BasePlan will not be + // automatically available any new locations Play may launch in the + // future. + OtherRegionsConfig *OtherRegionsBasePlanConfig `json:"otherRegionsConfig,omitempty"` + + // PrepaidBasePlanType: Set when the base plan does not automatically + // renew at the end of the billing period. + PrepaidBasePlanType *PrepaidBasePlanType `json:"prepaidBasePlanType,omitempty"` + + // RegionalConfigs: Region-specific information for this base plan. + RegionalConfigs []*RegionalBasePlanConfig `json:"regionalConfigs,omitempty"` + + // State: Output only. The state of the base plan, i.e. whether it's + // active. Draft and inactive base plans can be activated or deleted. + // Active base plans can be made inactive. Inactive base plans can be + // canceled. This field cannot be changed by updating the resource. Use + // the dedicated endpoints instead. + // + // Possible values: + // "STATE_UNSPECIFIED" - Unspecified state. + // "DRAFT" - The base plan is currently in a draft state, and hasn't + // been activated. It can be safely deleted at this point. + // "ACTIVE" - The base plan is active and available for new + // subscribers. + // "INACTIVE" - The base plan is inactive and only available for + // existing subscribers. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AutoRenewingBasePlanType") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AutoRenewingBasePlanType") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *BasePlan) MarshalJSON() ([]byte, error) { + type NoMethod BasePlan + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Bundle: Information about an app bundle. The resource for // BundlesService. type Bundle struct { @@ -786,6 +1049,94 @@ func (s *BundlesListResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CancelSurveyResult: Result of the cancel survey when the subscription +// was canceled by the user. +type CancelSurveyResult struct { + // Reason: The reason the user selected in the cancel survey. + // + // Possible values: + // "CANCEL_SURVEY_REASON_UNSPECIFIED" - Unspecified cancel survey + // reason. + // "CANCEL_SURVEY_REASON_NOT_ENOUGH_USAGE" - Not enough usage of the + // subscription. + // "CANCEL_SURVEY_REASON_TECHNICAL_ISSUES" - Technical issues while + // using the app. + // "CANCEL_SURVEY_REASON_COST_RELATED" - Cost related issues. + // "CANCEL_SURVEY_REASON_FOUND_BETTER_APP" - The user found a better + // app. + // "CANCEL_SURVEY_REASON_OTHERS" - Other reasons. + Reason string `json:"reason,omitempty"` + + // ReasonUserInput: Only set for CANCEL_SURVEY_REASON_OTHERS. This is + // the user's freeform response to the survey. + ReasonUserInput string `json:"reasonUserInput,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Reason") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Reason") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CancelSurveyResult) MarshalJSON() ([]byte, error) { + type NoMethod CancelSurveyResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CanceledStateContext: Information specific to a subscription in +// canceled state. +type CanceledStateContext struct { + // DeveloperInitiatedCancellation: Subscription was canceled by the + // developer. + DeveloperInitiatedCancellation *DeveloperInitiatedCancellation `json:"developerInitiatedCancellation,omitempty"` + + // ReplacementCancellation: Subscription was replaced by a new + // subscription. + ReplacementCancellation *ReplacementCancellation `json:"replacementCancellation,omitempty"` + + // SystemInitiatedCancellation: Subscription was canceled by the system, + // for example because of a billing problem. + SystemInitiatedCancellation *SystemInitiatedCancellation `json:"systemInitiatedCancellation,omitempty"` + + // UserInitiatedCancellation: Subscription was canceled by user. + UserInitiatedCancellation *UserInitiatedCancellation `json:"userInitiatedCancellation,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DeveloperInitiatedCancellation") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "DeveloperInitiatedCancellation") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CanceledStateContext) MarshalJSON() ([]byte, error) { + type NoMethod CanceledStateContext + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Comment: An entry of conversation between user and developer. type Comment struct { // DeveloperComment: A comment from a developer. @@ -988,6 +1339,15 @@ func (s *CountryTargeting) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// DeactivateBasePlanRequest: Request message for DeactivateBasePlan. +type DeactivateBasePlanRequest struct { +} + +// DeactivateSubscriptionOfferRequest: Request message for +// DeactivateSubscriptionOffer. +type DeactivateSubscriptionOfferRequest struct { +} + // DeobfuscationFile: Represents a deobfuscation file. type DeobfuscationFile struct { // SymbolType: The type of the deobfuscation file. @@ -1087,6 +1447,11 @@ func (s *DeveloperComment) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// DeveloperInitiatedCancellation: Information specific to cancellations +// initiated by developers. +type DeveloperInitiatedCancellation struct { +} + // DeviceGroup: LINT.IfChange A group of devices. A group is defined by // a set of device selectors. A device belongs to the group if it // matches any selector (logical OR). @@ -1518,6 +1883,53 @@ func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ExternalAccountIdentifiers: User account identifier in the +// third-party service. +type ExternalAccountIdentifiers struct { + // ExternalAccountId: User account identifier in the third-party + // service. Only present if account linking happened as part of the + // subscription purchase flow. + ExternalAccountId string `json:"externalAccountId,omitempty"` + + // ObfuscatedExternalAccountId: An obfuscated version of the id that is + // uniquely associated with the user's account in your app. Present for + // the following purchases: * If account linking happened as part of the + // subscription purchase flow. * It was specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid + // when the purchase was made. + ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` + + // ObfuscatedExternalProfileId: An obfuscated version of the id that is + // uniquely associated with the user's profile in your app. Only present + // if specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid + // when the purchase was made. + ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExternalAccountId") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExternalAccountId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ExternalAccountIdentifiers) MarshalJSON() ([]byte, error) { + type NoMethod ExternalAccountIdentifiers + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ExternallyHostedApk: Defines an APK available for this application // that is hosted externally and not uploaded to Google Play. This // function is only available to organizations using Managed Play whose @@ -2322,16 +2734,17 @@ func (s *ListDeviceTierConfigsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListUsersResponse: A response containing one or more users with -// access to an account. -type ListUsersResponse struct { - // NextPageToken: A token to pass to subsequent calls in order to - // retrieve subsequent results. This will not be set if there are no - // more results to return. +// ListSubscriptionOffersResponse: Response message for +// ListSubscriptionOffers. +type ListSubscriptionOffersResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. NextPageToken string `json:"nextPageToken,omitempty"` - // Users: The resulting users. - Users []*User `json:"users,omitempty"` + // SubscriptionOffers: The subscription offers from the specified + // subscription. + SubscriptionOffers []*SubscriptionOffer `json:"subscriptionOffers,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. @@ -2354,25 +2767,100 @@ type ListUsersResponse struct { NullFields []string `json:"-"` } -func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { - type NoMethod ListUsersResponse +func (s *ListSubscriptionOffersResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListSubscriptionOffersResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Listing: A localized store listing. The resource for ListingsService. -type Listing struct { - // FullDescription: Full description of the app. - FullDescription string `json:"fullDescription,omitempty"` +// ListSubscriptionsResponse: Response message for ListSubscriptions. +type ListSubscriptionsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` - // Language: Language localization code (a BCP-47 language tag; for - // example, "de-AT" for Austrian German). - Language string `json:"language,omitempty"` + // Subscriptions: The subscriptions from the specified app. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` - // ShortDescription: Short description of the app. - ShortDescription string `json:"shortDescription,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // Title: Localized title of the app. + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListSubscriptionsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListUsersResponse: A response containing one or more users with +// access to an account. +type ListUsersResponse struct { + // NextPageToken: A token to pass to subsequent calls in order to + // retrieve subsequent results. This will not be set if there are no + // more results to return. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Users: The resulting users. + Users []*User `json:"users,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListUsersResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Listing: A localized store listing. The resource for ListingsService. +type Listing struct { + // FullDescription: Full description of the app. + FullDescription string `json:"fullDescription,omitempty"` + + // Language: Language localization code (a BCP-47 language tag; for + // example, "de-AT" for Austrian German). + Language string `json:"language,omitempty"` + + // ShortDescription: Short description of the app. + ShortDescription string `json:"shortDescription,omitempty"` + + // Title: Localized title of the app. Title string `json:"title,omitempty"` // Video: URL of a promotional YouTube video for the app. @@ -2519,6 +3007,49 @@ func (s *ManagedProductTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MigrateBasePlanPricesRequest: Request message for +// MigrateBasePlanPrices. +type MigrateBasePlanPricesRequest struct { + // RegionalPriceMigrations: Required. The regional prices to update. + RegionalPriceMigrations []*RegionalPriceMigrationConfig `json:"regionalPriceMigrations,omitempty"` + + // RegionsVersion: Required. The version of the available regions being + // used for the regional_price_migrations. + RegionsVersion *RegionsVersion `json:"regionsVersion,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "RegionalPriceMigrations") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "RegionalPriceMigrations") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *MigrateBasePlanPricesRequest) MarshalJSON() ([]byte, error) { + type NoMethod MigrateBasePlanPricesRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// MigrateBasePlanPricesResponse: Response message for +// MigrateBasePlanPrices. +type MigrateBasePlanPricesResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + // Money: Represents an amount of money with its currency type. type Money struct { // CurrencyCode: The three-letter currency code defined in ISO 4217. @@ -2559,22 +3090,15 @@ func (s *Money) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// PageInfo: Information about the current page. List operations that -// supports paging return only one "page" of results. This protocol -// buffer message describes the page that has been returned. -type PageInfo struct { - // ResultPerPage: Maximum number of results returned in one page. ! The - // number of results included in the API response. - ResultPerPage int64 `json:"resultPerPage,omitempty"` - - // StartIndex: Index of the first result returned in the current page. - StartIndex int64 `json:"startIndex,omitempty"` - - // TotalResults: Total number of results available on the backend ! The - // total number of results in the result set. - TotalResults int64 `json:"totalResults,omitempty"` +// OfferTag: Represents a custom tag specified for base plans and +// subscription offers. +type OfferTag struct { + // Tag: Must conform with RFC-1034. That is, this string can only + // contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and + // be at most 20 characters. + Tag string `json:"tag,omitempty"` - // ForceSendFields is a list of field names (e.g. "ResultPerPage") to + // ForceSendFields is a list of field names (e.g. "Tag") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2582,32 +3106,38 @@ type PageInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ResultPerPage") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Tag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *PageInfo) MarshalJSON() ([]byte, error) { - type NoMethod PageInfo +func (s *OfferTag) MarshalJSON() ([]byte, error) { + type NoMethod OfferTag raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Price: Definition of a price, i.e. currency and units. -type Price struct { - // Currency: 3 letter Currency code, as defined by ISO 4217. See - // java/com/google/common/money/CurrencyCode.java - Currency string `json:"currency,omitempty"` +// OtherRegionsBasePlanConfig: Pricing information for any new locations +// Play may launch in. +type OtherRegionsBasePlanConfig struct { + // EurPrice: Required. Price in EUR to use for any new locations Play + // may launch in. + EurPrice *Money `json:"eurPrice,omitempty"` - // PriceMicros: Price in 1/million of the currency base unit, - // represented as a string. - PriceMicros string `json:"priceMicros,omitempty"` + // NewSubscriberAvailability: Whether the base plan is available for new + // subscribers in any new locations Play may launch in. If not + // specified, this will default to false. + NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` - // ForceSendFields is a list of field names (e.g. "Currency") to + // UsdPrice: Required. Price in USD to use for any new locations Play + // may launch in. + UsdPrice *Money `json:"usdPrice,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EurPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2615,7 +3145,7 @@ type Price struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Currency") to include in + // NullFields is a list of field names (e.g. "EurPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2624,123 +3154,83 @@ type Price struct { NullFields []string `json:"-"` } -func (s *Price) MarshalJSON() ([]byte, error) { - type NoMethod Price +func (s *OtherRegionsBasePlanConfig) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsBasePlanConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ProductPurchase: A ProductPurchase resource indicates the status of a -// user's inapp product purchase. -type ProductPurchase struct { - // AcknowledgementState: The acknowledgement state of the inapp product. - // Possible values are: 0. Yet to be acknowledged 1. Acknowledged - AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - - // ConsumptionState: The consumption state of the inapp product. - // Possible values are: 0. Yet to be consumed 1. Consumed - ConsumptionState int64 `json:"consumptionState,omitempty"` - - // DeveloperPayload: A developer-specified string that contains - // supplemental information about an order. - DeveloperPayload string `json:"developerPayload,omitempty"` - - // Kind: This kind represents an inappPurchase object in the - // androidpublisher service. - Kind string `json:"kind,omitempty"` - - // ObfuscatedExternalAccountId: An obfuscated version of the id that is - // uniquely associated with the user's account in your app. Only present - // if specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid - // when the purchase was made. - ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` - - // ObfuscatedExternalProfileId: An obfuscated version of the id that is - // uniquely associated with the user's profile in your app. Only present - // if specified using - // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid - // when the purchase was made. - ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` - - // OrderId: The order id associated with the purchase of the inapp - // product. - OrderId string `json:"orderId,omitempty"` - - // ProductId: The inapp product SKU. May not be present. - ProductId string `json:"productId,omitempty"` - - // PurchaseState: The purchase state of the order. Possible values are: - // 0. Purchased 1. Canceled 2. Pending - PurchaseState int64 `json:"purchaseState,omitempty"` - - // PurchaseTimeMillis: The time the product was purchased, in - // milliseconds since the epoch (Jan 1, 1970). - PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` - - // PurchaseToken: The purchase token generated to identify this - // purchase. May not be present. - PurchaseToken string `json:"purchaseToken,omitempty"` - - // PurchaseType: The type of purchase of the inapp product. This field - // is only set if this purchase was not made using the standard in-app - // billing flow. Possible values are: 0. Test (i.e. purchased from a - // license testing account) 1. Promo (i.e. purchased using a promo code) - // 2. Rewarded (i.e. from watching a video ad instead of paying) - PurchaseType *int64 `json:"purchaseType,omitempty"` - - // Quantity: The quantity associated with the purchase of the inapp - // product. If not present, the quantity is 1. - Quantity int64 `json:"quantity,omitempty"` - - // RegionCode: ISO 3166-1 alpha-2 billing region code of the user at the - // time the product was granted. - RegionCode string `json:"regionCode,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// OtherRegionsSubscriptionOfferConfig: Configuration for any new +// locations Play may launch in specified on a subscription offer. +type OtherRegionsSubscriptionOfferConfig struct { + // OtherRegionsNewSubscriberAvailability: Whether the subscription offer + // in any new locations Play may launch in the future. If not specified, + // this will default to false. + OtherRegionsNewSubscriberAvailability bool `json:"otherRegionsNewSubscriberAvailability,omitempty"` // ForceSendFields is a list of field names (e.g. - // "AcknowledgementState") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // "OtherRegionsNewSubscriberAvailability") to unconditionally include + // in API requests. By default, fields with empty or default values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AcknowledgementState") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. + // "OtherRegionsNewSubscriberAvailability") to include in API requests + // with the JSON null value. By default, fields with empty values are + // omitted from API requests. However, any field with an empty value + // appearing in NullFields will be sent to the server as null. It is an + // error if a field in this list has a non-empty value. This may be used + // to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ProductPurchase) MarshalJSON() ([]byte, error) { - type NoMethod ProductPurchase +func (s *OtherRegionsSubscriptionOfferConfig) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsSubscriptionOfferConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ProductPurchasesAcknowledgeRequest: Request for the -// product.purchases.acknowledge API. -type ProductPurchasesAcknowledgeRequest struct { - // DeveloperPayload: Payload to attach to the purchase. - DeveloperPayload string `json:"developerPayload,omitempty"` - - // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to - // unconditionally include in API requests. By default, fields with +// OtherRegionsSubscriptionOfferPhaseConfig: Configuration for any new +// locations Play may launch in for a single offer phase. +type OtherRegionsSubscriptionOfferPhaseConfig struct { + // AbsoluteDiscounts: The absolute amount of money subtracted from the + // base plan price prorated over the phase duration that the user pays + // for this offer phase. For example, if the base plan price for this + // region is $12 for a period of 1 year, then a $1 absolute discount for + // a phase of a duration of 3 months would correspond to a price of $2. + // The resulting price may not be smaller than the minimum price allowed + // for any new locations Play may launch in. + AbsoluteDiscounts *OtherRegionsSubscriptionOfferPhasePrices `json:"absoluteDiscounts,omitempty"` + + // OtherRegionsPrices: The absolute price the user pays for this offer + // phase. The price must not be smaller than the minimum price allowed + // for any new locations Play may launch in. + OtherRegionsPrices *OtherRegionsSubscriptionOfferPhasePrices `json:"otherRegionsPrices,omitempty"` + + // RelativeDiscount: The fraction of the base plan price prorated over + // the phase duration that the user pays for this offer phase. For + // example, if the base plan price for this region is $12 for a period + // of 1 year, then a 50% discount for a phase of a duration of 3 months + // would correspond to a price of $1.50. The discount must be specified + // as a fraction strictly larger than 0 and strictly smaller than 1. The + // resulting price will be rounded to the nearest billable unit (e.g. + // cents for USD). The relative discount is considered invalid if the + // discounted price ends up being smaller than the minimum price allowed + // in any new locations Play may launch in. + RelativeDiscount float64 `json:"relativeDiscount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AbsoluteDiscounts") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeveloperPayload") to + // NullFields is a list of field names (e.g. "AbsoluteDiscounts") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -2750,75 +3240,38 @@ type ProductPurchasesAcknowledgeRequest struct { NullFields []string `json:"-"` } -func (s *ProductPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { - type NoMethod ProductPurchasesAcknowledgeRequest +func (s *OtherRegionsSubscriptionOfferPhaseConfig) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsSubscriptionOfferPhaseConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// RegionalTaxRateInfo: Specified details about taxation in a given -// geographical region. -type RegionalTaxRateInfo struct { - // EligibleForStreamingServiceTaxRate: You must tell us if your app - // contains streaming products to correctly charge US state and local - // sales tax. Field only supported in United States. - EligibleForStreamingServiceTaxRate bool `json:"eligibleForStreamingServiceTaxRate,omitempty"` - - // TaxTier: Tax tier to specify reduced tax rate. Developers who sell - // digital news, magazines, newspapers, books, or audiobooks in various - // regions may be eligible for reduced tax rates. Learn more - // (https://support.google.com/googleplay/android-developer/answer/10463498). - // - // Possible values: - // "TAX_TIER_UNSPECIFIED" - // "TAX_TIER_BOOKS_1" - // "TAX_TIER_NEWS_1" - // "TAX_TIER_NEWS_2" - // "TAX_TIER_MUSIC_OR_AUDIO_1" - // "TAX_TIER_LIVE_OR_BROADCAST_1" - TaxTier string `json:"taxTier,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "EligibleForStreamingServiceTaxRate") to unconditionally include in - // API requests. By default, fields with empty or default values are - // omitted from API requests. However, any non-pointer, non-interface - // field appearing in ForceSendFields will be sent to the server - // regardless of whether the field is empty or not. This may be used to - // include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. - // "EligibleForStreamingServiceTaxRate") to include in API requests with - // the JSON null value. By default, fields with empty values are omitted - // from API requests. However, any field with an empty value appearing - // in NullFields will be sent to the server as null. It is an error if a - // field in this list has a non-empty value. This may be used to include - // null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *RegionalTaxRateInfo) MarshalJSON() ([]byte, error) { - type NoMethod RegionalTaxRateInfo - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +func (s *OtherRegionsSubscriptionOfferPhaseConfig) UnmarshalJSON(data []byte) error { + type NoMethod OtherRegionsSubscriptionOfferPhaseConfig + var s1 struct { + RelativeDiscount gensupport.JSONFloat64 `json:"relativeDiscount"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.RelativeDiscount = float64(s1.RelativeDiscount) + return nil } -// Review: An Android app review. -type Review struct { - // AuthorName: The name of the user who wrote the review. - AuthorName string `json:"authorName,omitempty"` - - // Comments: A repeated field containing comments for the review. - Comments []*Comment `json:"comments,omitempty"` - - // ReviewId: Unique identifier for this review. - ReviewId string `json:"reviewId,omitempty"` +// OtherRegionsSubscriptionOfferPhasePrices: Pricing information for any +// new locations Play may launch in. +type OtherRegionsSubscriptionOfferPhasePrices struct { + // EurPrice: Required. Price in EUR to use for any new locations Play + // may launch in. + EurPrice *Money `json:"eurPrice,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // UsdPrice: Required. Price in USD to use for any new locations Play + // may launch in. + UsdPrice *Money `json:"usdPrice,omitempty"` - // ForceSendFields is a list of field names (e.g. "AuthorName") to + // ForceSendFields is a list of field names (e.g. "EurPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2826,7 +3279,7 @@ type Review struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AuthorName") to include in + // NullFields is a list of field names (e.g. "EurPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2835,21 +3288,28 @@ type Review struct { NullFields []string `json:"-"` } -func (s *Review) MarshalJSON() ([]byte, error) { - type NoMethod Review +func (s *OtherRegionsSubscriptionOfferPhasePrices) MarshalJSON() ([]byte, error) { + type NoMethod OtherRegionsSubscriptionOfferPhasePrices raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewReplyResult: The result of replying/updating a reply to review. -type ReviewReplyResult struct { - // LastEdited: The time at which the reply took effect. - LastEdited *Timestamp `json:"lastEdited,omitempty"` +// PageInfo: Information about the current page. List operations that +// supports paging return only one "page" of results. This protocol +// buffer message describes the page that has been returned. +type PageInfo struct { + // ResultPerPage: Maximum number of results returned in one page. ! The + // number of results included in the API response. + ResultPerPage int64 `json:"resultPerPage,omitempty"` - // ReplyText: The reply text that was applied. - ReplyText string `json:"replyText,omitempty"` + // StartIndex: Index of the first result returned in the current page. + StartIndex int64 `json:"startIndex,omitempty"` - // ForceSendFields is a list of field names (e.g. "LastEdited") to + // TotalResults: Total number of results available on the backend ! The + // total number of results in the result set. + TotalResults int64 `json:"totalResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResultPerPage") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2857,38 +3317,29 @@ type ReviewReplyResult struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "LastEdited") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "ResultPerPage") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) { - type NoMethod ReviewReplyResult +func (s *PageInfo) MarshalJSON() ([]byte, error) { + type NoMethod PageInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewsListResponse: Response listing reviews. -type ReviewsListResponse struct { - // PageInfo: Information about the current page. - PageInfo *PageInfo `json:"pageInfo,omitempty"` - - // Reviews: List of reviews. - Reviews []*Review `json:"reviews,omitempty"` - - // TokenPagination: Pagination token, to handle a number of products - // that is over one page. - TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// PausedStateContext: Information specific to a subscription in paused +// state. +type PausedStateContext struct { + // AutoResumeTime: Time at which the subscription will be automatically + // resumed. + AutoResumeTime string `json:"autoResumeTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "PageInfo") to + // ForceSendFields is a list of field names (e.g. "AutoResumeTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2896,292 +3347,155 @@ type ReviewsListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageInfo") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AutoResumeTime") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) { - type NoMethod ReviewsListResponse +func (s *PausedStateContext) MarshalJSON() ([]byte, error) { + type NoMethod PausedStateContext raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewsReplyRequest: Request to reply to review or update existing -// reply. -type ReviewsReplyRequest struct { - // ReplyText: The text to set as the reply. Replies of more than - // approximately 350 characters will be rejected. HTML tags will be - // stripped. - ReplyText string `json:"replyText,omitempty"` +// PrepaidBasePlanType: Represents a base plan that does not +// automatically renew at the end of the base plan, and must be manually +// renewed by the user. +type PrepaidBasePlanType struct { + // BillingPeriodDuration: Required. Subscription period, specified in + // ISO 8601 format. For a list of acceptable billing periods, refer to + // the help center. + BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` - // ForceSendFields is a list of field names (e.g. "ReplyText") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // TimeExtension: Whether users should be able to extend this prepaid + // base plan in Google Play surfaces. Defaults to TIME_EXTENSION_ACTIVE + // if not specified. + // + // Possible values: + // "TIME_EXTENSION_UNSPECIFIED" - Unspecified state. + // "TIME_EXTENSION_ACTIVE" - Time extension is active. Users are + // allowed to top-up or extend their prepaid plan. + // "TIME_EXTENSION_INACTIVE" - Time extension is inactive. Users + // cannot top-up or extend their prepaid plan. + TimeExtension string `json:"timeExtension,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BillingPeriodDuration") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ReplyText") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) { - type NoMethod ReviewsReplyRequest +func (s *PrepaidBasePlanType) MarshalJSON() ([]byte, error) { + type NoMethod PrepaidBasePlanType raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ReviewsReplyResponse: Response on status of replying to a review. -type ReviewsReplyResponse struct { - // Result: The result of replying/updating a reply to review. - Result *ReviewReplyResult `json:"result,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// PrepaidPlan: Information related to a prepaid plan. +type PrepaidPlan struct { + // AllowExtendAfterTime: After this time, the subscription is allowed + // for a new top-up purchase. Not present if the subscription is already + // extended by a top-up purchase. + AllowExtendAfterTime string `json:"allowExtendAfterTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Result") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "AllowExtendAfterTime") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Result") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AllowExtendAfterTime") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) { - type NoMethod ReviewsReplyResponse +func (s *PrepaidPlan) MarshalJSON() ([]byte, error) { + type NoMethod PrepaidPlan raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionCancelSurveyResult: Information provided by the user when -// they complete the subscription cancellation flow (cancellation reason -// survey). -type SubscriptionCancelSurveyResult struct { - // CancelSurveyReason: The cancellation reason the user chose in the - // survey. Possible values are: 0. Other 1. I don't use this service - // enough 2. Technical issues 3. Cost-related reasons 4. I found a - // better app - CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"` +// Price: Definition of a price, i.e. currency and units. +type Price struct { + // Currency: 3 letter Currency code, as defined by ISO 4217. See + // java/com/google/common/money/CurrencyCode.java + Currency string `json:"currency,omitempty"` - // UserInputCancelReason: The customized input cancel reason from the - // user. Only present when cancelReason is 0. - UserInputCancelReason string `json:"userInputCancelReason,omitempty"` + // PriceMicros: Price in 1/million of the currency base unit, + // represented as a string. + PriceMicros string `json:"priceMicros,omitempty"` - // ForceSendFields is a list of field names (e.g. "CancelSurveyReason") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CancelSurveyReason") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Currency") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionCancelSurveyResult +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the -// data needed to defer a subscription purchase to a future expiry time. -type SubscriptionDeferralInfo struct { - // DesiredExpiryTimeMillis: The desired next expiry time to assign to - // the subscription, in milliseconds since the Epoch. The given time - // must be later/greater than the current expiry time for the - // subscription. - DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"` +// ProductPurchase: A ProductPurchase resource indicates the status of a +// user's inapp product purchase. +type ProductPurchase struct { + // AcknowledgementState: The acknowledgement state of the inapp product. + // Possible values are: 0. Yet to be acknowledged 1. Acknowledged + AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - // ExpectedExpiryTimeMillis: The expected expiry time for the - // subscription. If the current expiry time for the subscription is not - // the value specified here, the deferral will not occur. - ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. - // "DesiredExpiryTimeMillis") to unconditionally include in API - // requests. By default, fields with empty or default values are omitted - // from API requests. However, any non-pointer, non-interface field - // appearing in ForceSendFields will be sent to the server regardless of - // whether the field is empty or not. This may be used to include empty - // fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionDeferralInfo - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// SubscriptionPriceChange: Contains the price change information for a -// subscription that can be used to control the user journey for the -// price change in the app. This can be in the form of seeking -// confirmation from the user or tailoring the experience for a -// successful conversion. -type SubscriptionPriceChange struct { - // NewPrice: The new price the subscription will renew with if the price - // change is accepted by the user. - NewPrice *Price `json:"newPrice,omitempty"` - - // State: The current state of the price change. Possible values are: 0. - // Outstanding: State for a pending price change waiting for the user to - // agree. In this state, you can optionally seek confirmation from the - // user using the In-App API. 1. Accepted: State for an accepted price - // change that the subscription will renew with unless it's canceled. - // The price change takes effect on a future date when the subscription - // renews. Note that the change might not occur when the subscription is - // renewed next. - State int64 `json:"state,omitempty"` - - // ForceSendFields is a list of field names (e.g. "NewPrice") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "NewPrice") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} - -func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPriceChange - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// SubscriptionPurchase: A SubscriptionPurchase resource indicates the -// status of a user's subscription purchase. -type SubscriptionPurchase struct { - // AcknowledgementState: The acknowledgement state of the subscription - // product. Possible values are: 0. Yet to be acknowledged 1. - // Acknowledged - AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - - // AutoRenewing: Whether the subscription will automatically be renewed - // when it reaches its current expiry time. - AutoRenewing bool `json:"autoRenewing,omitempty"` - - // AutoResumeTimeMillis: Time at which the subscription will be - // automatically resumed, in milliseconds since the Epoch. Only present - // if the user has requested to pause the subscription. - AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis,omitempty,string"` - - // CancelReason: The reason why a subscription was canceled or is not - // auto-renewing. Possible values are: 0. User canceled the subscription - // 1. Subscription was canceled by the system, for example because of a - // billing problem 2. Subscription was replaced with a new subscription - // 3. Subscription was canceled by the developer - CancelReason int64 `json:"cancelReason,omitempty"` - - // CancelSurveyResult: Information provided by the user when they - // complete the subscription cancellation flow (cancellation reason - // survey). - CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"` - - // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the - // user at the time the subscription was granted. - CountryCode string `json:"countryCode,omitempty"` + // ConsumptionState: The consumption state of the inapp product. + // Possible values are: 0. Yet to be consumed 1. Consumed + ConsumptionState int64 `json:"consumptionState,omitempty"` // DeveloperPayload: A developer-specified string that contains // supplemental information about an order. DeveloperPayload string `json:"developerPayload,omitempty"` - // EmailAddress: The email address of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - EmailAddress string `json:"emailAddress,omitempty"` - - // ExpiryTimeMillis: Time at which the subscription will expire, in - // milliseconds since the Epoch. - ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"` - - // ExternalAccountId: User account identifier in the third-party - // service. Only present if account linking happened as part of the - // subscription purchase flow. - ExternalAccountId string `json:"externalAccountId,omitempty"` - - // FamilyName: The family name of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - FamilyName string `json:"familyName,omitempty"` - - // GivenName: The given name of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - GivenName string `json:"givenName,omitempty"` - - // IntroductoryPriceInfo: Introductory price information of the - // subscription. This is only present when the subscription was - // purchased with an introductory price. This field does not indicate - // the subscription is currently in introductory price period. - IntroductoryPriceInfo *IntroductoryPriceInfo `json:"introductoryPriceInfo,omitempty"` - - // Kind: This kind represents a subscriptionPurchase object in the + // Kind: This kind represents an inappPurchase object in the // androidpublisher service. Kind string `json:"kind,omitempty"` - // LinkedPurchaseToken: The purchase token of the originating purchase - // if this subscription is one of the following: 0. Re-signup of a - // canceled but non-lapsed subscription 1. Upgrade/downgrade from a - // previous subscription For example, suppose a user originally signs up - // and you receive purchase token X, then the user cancels and goes - // through the resignup flow (before their subscription lapses) and you - // receive purchase token Y, and finally the user upgrades their - // subscription and you receive purchase token Z. If you call this API - // with purchase token Z, this field will be set to Y. If you call this - // API with purchase token Y, this field will be set to X. If you call - // this API with purchase token X, this field will not be set. - LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` - // ObfuscatedExternalAccountId: An obfuscated version of the id that is - // uniquely associated with the user's account in your app. Present for - // the following purchases: * If account linking happened as part of the - // subscription purchase flow. * It was specified using + // uniquely associated with the user's account in your app. Only present + // if specified using // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid // when the purchase was made. ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` @@ -3193,72 +3507,39 @@ type SubscriptionPurchase struct { // when the purchase was made. ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` - // OrderId: The order id of the latest recurring order associated with - // the purchase of the subscription. If the subscription was canceled - // because payment was declined, this will be the order id from the - // payment declined order. + // OrderId: The order id associated with the purchase of the inapp + // product. OrderId string `json:"orderId,omitempty"` - // PaymentState: The payment state of the subscription. Possible values - // are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending - // deferred upgrade/downgrade Not present for canceled, expired - // subscriptions. - PaymentState int64 `json:"paymentState,omitempty"` - - // PriceAmountMicros: Price of the subscription, For tax exclusive - // countries, the price doesn't include tax. For tax inclusive - // countries, the price includes tax. Price is expressed in micro-units, - // where 1,000,000 micro-units represents one unit of the currency. For - // example, if the subscription price is €1.99, price_amount_micros is - // 1990000. - PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"` - - // PriceChange: The latest price change information available. This is - // present only when there is an upcoming price change for the - // subscription yet to be applied. Once the subscription renews with the - // new price or the subscription is canceled, no price change - // information will be returned. - PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"` - - // PriceCurrencyCode: ISO 4217 currency code for the subscription price. - // For example, if the price is specified in British pounds sterling, - // price_currency_code is "GBP". - PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"` - - // ProfileId: The Google profile id of the user when the subscription - // was purchased. Only present for purchases made with 'Subscribe with - // Google'. - ProfileId string `json:"profileId,omitempty"` + // ProductId: The inapp product SKU. May not be present. + ProductId string `json:"productId,omitempty"` - // ProfileName: The profile name of the user when the subscription was - // purchased. Only present for purchases made with 'Subscribe with - // Google'. - ProfileName string `json:"profileName,omitempty"` + // PurchaseState: The purchase state of the order. Possible values are: + // 0. Purchased 1. Canceled 2. Pending + PurchaseState int64 `json:"purchaseState,omitempty"` - // PromotionCode: The promotion code applied on this purchase. This - // field is only set if a vanity code promotion is applied when the - // subscription was purchased. - PromotionCode string `json:"promotionCode,omitempty"` + // PurchaseTimeMillis: The time the product was purchased, in + // milliseconds since the epoch (Jan 1, 1970). + PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` - // PromotionType: The type of promotion applied on this purchase. This - // field is only set if a promotion is applied when the subscription was - // purchased. Possible values are: 0. One time code 1. Vanity code - PromotionType int64 `json:"promotionType,omitempty"` + // PurchaseToken: The purchase token generated to identify this + // purchase. May not be present. + PurchaseToken string `json:"purchaseToken,omitempty"` - // PurchaseType: The type of purchase of the subscription. This field is - // only set if this purchase was not made using the standard in-app + // PurchaseType: The type of purchase of the inapp product. This field + // is only set if this purchase was not made using the standard in-app // billing flow. Possible values are: 0. Test (i.e. purchased from a // license testing account) 1. Promo (i.e. purchased using a promo code) + // 2. Rewarded (i.e. from watching a video ad instead of paying) PurchaseType *int64 `json:"purchaseType,omitempty"` - // StartTimeMillis: Time at which the subscription was granted, in - // milliseconds since the Epoch. - StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + // Quantity: The quantity associated with the purchase of the inapp + // product. If not present, the quantity is 1. + Quantity int64 `json:"quantity,omitempty"` - // UserCancellationTimeMillis: The time at which the subscription was - // canceled by the user, in milliseconds since the epoch. Only present - // if cancelReason is 0. - UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"` + // RegionCode: ISO 3166-1 alpha-2 billing region code of the user at the + // time the product was granted. + RegionCode string `json:"regionCode,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. @@ -3283,15 +3564,15 @@ type SubscriptionPurchase struct { NullFields []string `json:"-"` } -func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchase +func (s *ProductPurchase) MarshalJSON() ([]byte, error) { + type NoMethod ProductPurchase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchasesAcknowledgeRequest: Request for the -// purchases.subscriptions.acknowledge API. -type SubscriptionPurchasesAcknowledgeRequest struct { +// ProductPurchasesAcknowledgeRequest: Request for the +// product.purchases.acknowledge API. +type ProductPurchasesAcknowledgeRequest struct { // DeveloperPayload: Payload to attach to the purchase. DeveloperPayload string `json:"developerPayload,omitempty"` @@ -3313,133 +3594,167 @@ type SubscriptionPurchasesAcknowledgeRequest struct { NullFields []string `json:"-"` } -func (s *SubscriptionPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchasesAcknowledgeRequest +func (s *ProductPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { + type NoMethod ProductPurchasesAcknowledgeRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchasesDeferRequest: Request for the -// purchases.subscriptions.defer API. -type SubscriptionPurchasesDeferRequest struct { - // DeferralInfo: The information about the new desired expiry time for - // the subscription. - DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"` +// RegionalBasePlanConfig: Configuration for a base plan specific to a +// region. +type RegionalBasePlanConfig struct { + // NewSubscriberAvailability: Whether the base plan in the specified + // region is available for new subscribers. Existing subscribers will + // not have their subscription canceled if this value is set to false. + // If not specified, this will default to false. + NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` - // ForceSendFields is a list of field names (e.g. "DeferralInfo") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // Price: The price of the base plan in the specified region. Must be + // set if the base plan is available to new subscribers. Must be set in + // the currency that is linked to the specified region. + Price *Money `json:"price,omitempty"` - // NullFields is a list of field names (e.g. "DeferralInfo") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // RegionCode: Required. Region code this configuration applies to, as + // defined by ISO 3166-2, e.g. "US". + RegionCode string `json:"regionCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "NewSubscriberAvailability") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "NewSubscriberAvailability") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. However, any field with an empty value appearing in + // NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchasesDeferRequest +func (s *RegionalBasePlanConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalBasePlanConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionPurchasesDeferResponse: Response for the -// purchases.subscriptions.defer API. -type SubscriptionPurchasesDeferResponse struct { - // NewExpiryTimeMillis: The new expiry time for the subscription in - // milliseconds since the Epoch. - NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"` +// RegionalPriceMigrationConfig: Configuration for a price migration. +type RegionalPriceMigrationConfig struct { + // OldestAllowedPriceVersionTime: Required. The cutoff time for + // historical prices that subscribers can remain paying. Subscribers who + // are on a price that was created before this cutoff time will be + // migrated to the currently-offered price. These subscribers will + // receive a notification that they will be paying a different price. + // Subscribers who do not agree to the new price will have their + // subscription ended at the next renewal. + OldestAllowedPriceVersionTime string `json:"oldestAllowedPriceVersionTime,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // RegionCode: Required. Region code this configuration applies to, as + // defined by ISO 3166-2, e.g. "US". + RegionCode string `json:"regionCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis") - // to unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "OldestAllowedPriceVersionTime") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. + // "OldestAllowedPriceVersionTime") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionPurchasesDeferResponse +func (s *RegionalPriceMigrationConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalPriceMigrationConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SubscriptionTaxAndComplianceSettings: Details about taxation, Google -// Play policy and legal compliance for subscription products. -type SubscriptionTaxAndComplianceSettings struct { - // EeaWithdrawalRightType: Digital content or service classification for - // products distributed to users in the European Economic Area (EEA). - // The withdrawal regime under EEA consumer laws depends on this - // classification. Refer to the Help Center article - // (https://support.google.com/googleplay/android-developer/answer/10463498) - // for more information. - // - // Possible values: - // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" - // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" - // "WITHDRAWAL_RIGHT_SERVICE" - EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` +// RegionalSubscriptionOfferConfig: Configuration for a subscription +// offer in a single region. +type RegionalSubscriptionOfferConfig struct { + // NewSubscriberAvailability: Whether the subscription offer in the + // specified region is available for new subscribers. Existing + // subscribers will not have their subscription cancelled if this value + // is set to false. If not specified, this will default to false. + NewSubscriberAvailability bool `json:"newSubscriberAvailability,omitempty"` - // TaxRateInfoByRegionCode: A mapping from region code to tax rate - // details. The keys are region codes as defined by Unicode's "CLDR". - TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` + // RegionCode: Required. Immutable. Region code this configuration + // applies to, as defined by ISO 3166-2, e.g. "US". + RegionCode string `json:"regionCode,omitempty"` // ForceSendFields is a list of field names (e.g. - // "EeaWithdrawalRightType") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // "NewSubscriberAvailability") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") - // to include in API requests with the JSON null value. By default, - // fields with empty values are omitted from API requests. However, any - // field with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. + // "NewSubscriberAvailability") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. However, any field with an empty value appearing in + // NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SubscriptionTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { - type NoMethod SubscriptionTaxAndComplianceSettings +func (s *RegionalSubscriptionOfferConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalSubscriptionOfferConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SystemApksListResponse: Response to list previously created system -// APK variants. -type SystemApksListResponse struct { - // Variants: All system APK variants created. - Variants []*Variant `json:"variants,omitempty"` +// RegionalSubscriptionOfferPhaseConfig: Configuration for a single +// phase of a subscription offer in a single region. +type RegionalSubscriptionOfferPhaseConfig struct { + // AbsoluteDiscount: The absolute amount of money subtracted from the + // base plan price prorated over the phase duration that the user pays + // for this offer phase. For example, if the base plan price for this + // region is $12 for a period of 1 year, then a $1 absolute discount for + // a phase of a duration of 3 months would correspond to a price of $2. + // The resulting price may not be smaller than the minimum price allowed + // for this region. + AbsoluteDiscount *Money `json:"absoluteDiscount,omitempty"` + + // Price: The absolute price the user pays for this offer phase. The + // price must not be smaller than the minimum price allowed for this + // region. + Price *Money `json:"price,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // RegionCode: Required. Immutable. The region to which this config + // applies. + RegionCode string `json:"regionCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "Variants") to + // RelativeDiscount: The fraction of the base plan price prorated over + // the phase duration that the user pays for this offer phase. For + // example, if the base plan price for this region is $12 for a period + // of 1 year, then a 50% discount for a phase of a duration of 3 months + // would correspond to a price of $1.50. The discount must be specified + // as a fraction strictly larger than 0 and strictly smaller than 1. The + // resulting price will be rounded to the nearest billable unit (e.g. + // cents for USD). The relative discount is considered invalid if the + // discounted price ends up being smaller than the minimum price allowed + // in this region. + RelativeDiscount float64 `json:"relativeDiscount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AbsoluteDiscount") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3447,27 +3762,91 @@ type SystemApksListResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Variants") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AbsoluteDiscount") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *SystemApksListResponse) MarshalJSON() ([]byte, error) { - type NoMethod SystemApksListResponse +func (s *RegionalSubscriptionOfferPhaseConfig) MarshalJSON() ([]byte, error) { + type NoMethod RegionalSubscriptionOfferPhaseConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SystemFeature: Representation of a system feature. -type SystemFeature struct { - // Name: The name of the feature. - Name string `json:"name,omitempty"` +func (s *RegionalSubscriptionOfferPhaseConfig) UnmarshalJSON(data []byte) error { + type NoMethod RegionalSubscriptionOfferPhaseConfig + var s1 struct { + RelativeDiscount gensupport.JSONFloat64 `json:"relativeDiscount"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.RelativeDiscount = float64(s1.RelativeDiscount) + return nil +} - // ForceSendFields is a list of field names (e.g. "Name") to +// RegionalTaxRateInfo: Specified details about taxation in a given +// geographical region. +type RegionalTaxRateInfo struct { + // EligibleForStreamingServiceTaxRate: You must tell us if your app + // contains streaming products to correctly charge US state and local + // sales tax. Field only supported in United States. + EligibleForStreamingServiceTaxRate bool `json:"eligibleForStreamingServiceTaxRate,omitempty"` + + // TaxTier: Tax tier to specify reduced tax rate. Developers who sell + // digital news, magazines, newspapers, books, or audiobooks in various + // regions may be eligible for reduced tax rates. Learn more + // (https://support.google.com/googleplay/android-developer/answer/10463498). + // + // Possible values: + // "TAX_TIER_UNSPECIFIED" + // "TAX_TIER_BOOKS_1" + // "TAX_TIER_NEWS_1" + // "TAX_TIER_NEWS_2" + // "TAX_TIER_MUSIC_OR_AUDIO_1" + // "TAX_TIER_LIVE_OR_BROADCAST_1" + TaxTier string `json:"taxTier,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "EligibleForStreamingServiceTaxRate") to unconditionally include in + // API requests. By default, fields with empty or default values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "EligibleForStreamingServiceTaxRate") to include in API requests with + // the JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *RegionalTaxRateInfo) MarshalJSON() ([]byte, error) { + type NoMethod RegionalTaxRateInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// RegionsVersion: The version of the available regions being used for +// the specified resource. +type RegionsVersion struct { + // Version: Required. A string representing version of the available + // regions being used for the specified resource. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Version") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3475,8 +3854,8 @@ type SystemFeature struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Name") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Version") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3484,24 +3863,33 @@ type SystemFeature struct { NullFields []string `json:"-"` } -func (s *SystemFeature) MarshalJSON() ([]byte, error) { - type NoMethod SystemFeature +func (s *RegionsVersion) MarshalJSON() ([]byte, error) { + type NoMethod RegionsVersion raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Testers: The testers of an app. The resource for TestersService. -// Note: while it is possible in the Play Console UI to add testers via -// email lists, email lists are not supported by this resource. -type Testers struct { - // GoogleGroups: All testing Google Groups, as email addresses. - GoogleGroups []string `json:"googleGroups,omitempty"` +// ReplacementCancellation: Information specific to cancellations caused +// by subscription replacement. +type ReplacementCancellation struct { +} + +// Review: An Android app review. +type Review struct { + // AuthorName: The name of the user who wrote the review. + AuthorName string `json:"authorName,omitempty"` + + // Comments: A repeated field containing comments for the review. + Comments []*Comment `json:"comments,omitempty"` + + // ReviewId: Unique identifier for this review. + ReviewId string `json:"reviewId,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "GoogleGroups") to + // ForceSendFields is a list of field names (e.g. "AuthorName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3509,34 +3897,30 @@ type Testers struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GoogleGroups") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "AuthorName") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *Testers) MarshalJSON() ([]byte, error) { - type NoMethod Testers +func (s *Review) MarshalJSON() ([]byte, error) { + type NoMethod Review raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Timestamp: A Timestamp represents a point in time independent of any -// time zone or local calendar, encoded as a count of seconds and -// fractions of seconds at nanosecond resolution. The count is relative -// to an epoch at UTC midnight on January 1, 1970. -type Timestamp struct { - // Nanos: Non-negative fractions of a second at nanosecond resolution. - // Must be from 0 to 999,999,999 inclusive. - Nanos int64 `json:"nanos,omitempty"` +// ReviewReplyResult: The result of replying/updating a reply to review. +type ReviewReplyResult struct { + // LastEdited: The time at which the reply took effect. + LastEdited *Timestamp `json:"lastEdited,omitempty"` - // Seconds: Represents seconds of UTC time since Unix epoch. - Seconds int64 `json:"seconds,omitempty,string"` + // ReplyText: The reply text that was applied. + ReplyText string `json:"replyText,omitempty"` - // ForceSendFields is a list of field names (e.g. "Nanos") to + // ForceSendFields is a list of field names (e.g. "LastEdited") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3544,8 +3928,8 @@ type Timestamp struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Nanos") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "LastEdited") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3553,30 +3937,29 @@ type Timestamp struct { NullFields []string `json:"-"` } -func (s *Timestamp) MarshalJSON() ([]byte, error) { - type NoMethod Timestamp +func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) { + type NoMethod ReviewReplyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TokenPagination: Pagination information returned by a List operation -// when token pagination is enabled. List operations that supports -// paging return only one "page" of results. This protocol buffer -// message describes the page that has been returned. When using token -// pagination, clients should use the next/previous token to get another -// page of the result. The presence or absence of next/previous token -// indicates whether a next/previous page is available and provides a -// mean of accessing this page. ListRequest.page_token should be set to -// either next_page_token or previous_page_token to access another page. -type TokenPagination struct { - // NextPageToken: Tokens to pass to the standard list field - // 'page_token'. Whenever available, tokens are preferred over - // manipulating start_index. - NextPageToken string `json:"nextPageToken,omitempty"` +// ReviewsListResponse: Response listing reviews. +type ReviewsListResponse struct { + // PageInfo: Information about the current page. + PageInfo *PageInfo `json:"pageInfo,omitempty"` - PreviousPageToken string `json:"previousPageToken,omitempty"` + // Reviews: List of reviews. + Reviews []*Review `json:"reviews,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // TokenPagination: Pagination token, to handle a number of products + // that is over one page. + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PageInfo") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3584,35 +3967,30 @@ type TokenPagination struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "PageInfo") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *TokenPagination) MarshalJSON() ([]byte, error) { - type NoMethod TokenPagination +func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) { + type NoMethod ReviewsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Track: A track configuration. The resource for TracksService. -type Track struct { - // Releases: In a read request, represents all active releases in the - // track. In an update request, represents desired changes. - Releases []*TrackRelease `json:"releases,omitempty"` - - // Track: Identifier of the track. - Track string `json:"track,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// ReviewsReplyRequest: Request to reply to review or update existing +// reply. +type ReviewsReplyRequest struct { + // ReplyText: The text to set as the reply. Replies of more than + // approximately 350 characters will be rejected. HTML tags will be + // stripped. + ReplyText string `json:"replyText,omitempty"` - // ForceSendFields is a list of field names (e.g. "Releases") to + // ForceSendFields is a list of field names (e.g. "ReplyText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3620,7 +3998,7 @@ type Track struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Releases") to include in + // NullFields is a list of field names (e.g. "ReplyText") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3629,39 +4007,22 @@ type Track struct { NullFields []string `json:"-"` } -func (s *Track) MarshalJSON() ([]byte, error) { - type NoMethod Track +func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) { + type NoMethod ReviewsReplyRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TrackCountryAvailability: Resource for per-track country availability -// information. -type TrackCountryAvailability struct { - // Countries: A list of one or more countries where artifacts in this - // track are available. This list includes all countries that are - // targeted by the track, even if only specific carriers are targeted in - // that country. - Countries []*TrackTargetedCountry `json:"countries,omitempty"` - - // RestOfWorld: Whether artifacts in this track are available to "rest - // of the world" countries. - RestOfWorld bool `json:"restOfWorld,omitempty"` - - // SyncWithProduction: Whether this track's availability is synced with - // the default production track. See - // https://support.google.com/googleplay/android-developer/answer/7550024 - // for more information on syncing country availability with production. - // Note that if this is true, the returned "countries" and - // "rest_of_world" fields will reflect the values for the default - // production track. - SyncWithProduction bool `json:"syncWithProduction,omitempty"` +// ReviewsReplyResponse: Response on status of replying to a review. +type ReviewsReplyResponse struct { + // Result: The result of replying/updating a reply to review. + Result *ReviewReplyResult `json:"result,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Countries") to + // ForceSendFields is a list of field names (e.g. "Result") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3669,8 +4030,8 @@ type TrackCountryAvailability struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Countries") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Result") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3678,57 +4039,36 @@ type TrackCountryAvailability struct { NullFields []string `json:"-"` } -func (s *TrackCountryAvailability) MarshalJSON() ([]byte, error) { - type NoMethod TrackCountryAvailability +func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) { + type NoMethod ReviewsReplyResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TrackRelease: A release within a track. -type TrackRelease struct { - // CountryTargeting: Restricts a release to a specific set of countries. - CountryTargeting *CountryTargeting `json:"countryTargeting,omitempty"` - - // InAppUpdatePriority: In-app update priority of the release. All newly - // added APKs in the release will be considered at this priority. Can - // take values in the range [0, 5], with 5 the highest priority. - // Defaults to 0. in_app_update_priority can not be updated once the - // release is rolled out. See - // https://developer.android.com/guide/playcore/in-app-updates. - InAppUpdatePriority int64 `json:"inAppUpdatePriority,omitempty"` - - // Name: The release name. Not required to be unique. If not set, the - // name is generated from the APK's version_name. If the release - // contains multiple APKs, the name is generated from the date. - Name string `json:"name,omitempty"` +// SubscribeWithGoogleInfo: Information associated with purchases made +// with 'Subscribe with Google'. +type SubscribeWithGoogleInfo struct { + // EmailAddress: The email address of the user when the subscription was + // purchased. + EmailAddress string `json:"emailAddress,omitempty"` - // ReleaseNotes: A description of what is new in this release. - ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"` + // FamilyName: The family name of the user when the subscription was + // purchased. + FamilyName string `json:"familyName,omitempty"` - // Status: The status of the release. - // - // Possible values: - // "statusUnspecified" - Unspecified status. - // "draft" - The release's APKs are not being served to users. - // "inProgress" - The release's APKs are being served to a fraction of - // users, determined by 'user_fraction'. - // "halted" - The release's APKs will no longer be served to users. - // Users who already have these APKs are unaffected. - // "completed" - The release will have no further changes. Its APKs - // are being served to all users, unless they are eligible to APKs of a - // more recent release. - Status string `json:"status,omitempty"` + // GivenName: The given name of the user when the subscription was + // purchased. + GivenName string `json:"givenName,omitempty"` - // UserFraction: Fraction of users who are eligible for a staged - // release. 0 < fraction < 1. Can only be set when status is - // "inProgress" or "halted". - UserFraction float64 `json:"userFraction,omitempty"` + // ProfileId: The Google profile id of the user when the subscription + // was purchased. + ProfileId string `json:"profileId,omitempty"` - // VersionCodes: Version codes of all APKs in the release. Must include - // version codes to retain from previous releases. - VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"` + // ProfileName: The profile name of the user when the subscription was + // purchased. + ProfileName string `json:"profileName,omitempty"` - // ForceSendFields is a list of field names (e.g. "CountryTargeting") to + // ForceSendFields is a list of field names (e.g. "EmailAddress") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3736,43 +4076,56 @@ type TrackRelease struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CountryTargeting") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "EmailAddress") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *TrackRelease) MarshalJSON() ([]byte, error) { - type NoMethod TrackRelease +func (s *SubscribeWithGoogleInfo) MarshalJSON() ([]byte, error) { + type NoMethod SubscribeWithGoogleInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *TrackRelease) UnmarshalJSON(data []byte) error { - type NoMethod TrackRelease - var s1 struct { - UserFraction gensupport.JSONFloat64 `json:"userFraction"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.UserFraction = float64(s1.UserFraction) - return nil -} +// Subscription: A single subscription for an app. +type Subscription struct { + // Archived: Output only. Whether this subscription is archived. + // Archived subscriptions are not available to any subscriber any + // longer, cannot be updated, and are not returned in list requests + // unless the show archived flag is passed in. + Archived bool `json:"archived,omitempty"` -// TrackTargetedCountry: Representation of a single country where the -// contents of a track are available. -type TrackTargetedCountry struct { - // CountryCode: The country to target, as a two-letter CLDR code. - CountryCode string `json:"countryCode,omitempty"` + // BasePlans: The set of base plans for this subscription. Represents + // the prices and duration of the subscription if no other offers apply. + BasePlans []*BasePlan `json:"basePlans,omitempty"` - // ForceSendFields is a list of field names (e.g. "CountryCode") to + // Listings: Required. List of localized listings for this subscription. + // Must contain at least an entry for the default language of the parent + // app. + Listings []*SubscriptionListing `json:"listings,omitempty"` + + // PackageName: Immutable. Package name of the parent app. + PackageName string `json:"packageName,omitempty"` + + // ProductId: Immutable. Unique product ID of the product. Unique within + // the parent app. Product IDs must be composed of lower-case letters + // (a-z), numbers (0-9), underscores (_) and dots (.). It must start + // with a lower-case letter or number, and be between 1 and 40 + // (inclusive) characters in length. + ProductId string `json:"productId,omitempty"` + + // TaxAndComplianceSettings: Details about taxes and legal compliance. + TaxAndComplianceSettings *SubscriptionTaxAndComplianceSettings `json:"taxAndComplianceSettings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Archived") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3780,130 +4133,118 @@ type TrackTargetedCountry struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CountryCode") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Archived") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *TrackTargetedCountry) MarshalJSON() ([]byte, error) { - type NoMethod TrackTargetedCountry +func (s *Subscription) MarshalJSON() ([]byte, error) { + type NoMethod Subscription raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TracksListResponse: Response listing all tracks. -type TracksListResponse struct { - // Kind: The kind of this response - // ("androidpublisher#tracksListResponse"). - Kind string `json:"kind,omitempty"` - - // Tracks: All tracks. - Tracks []*Track `json:"tracks,omitempty"` +// SubscriptionCancelSurveyResult: Information provided by the user when +// they complete the subscription cancellation flow (cancellation reason +// survey). +type SubscriptionCancelSurveyResult struct { + // CancelSurveyReason: The cancellation reason the user chose in the + // survey. Possible values are: 0. Other 1. I don't use this service + // enough 2. Technical issues 3. Cost-related reasons 4. I found a + // better app + CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // UserInputCancelReason: The customized input cancel reason from the + // user. Only present when cancelReason is 0. + UserInputCancelReason string `json:"userInputCancelReason,omitempty"` - // ForceSendFields is a list of field names (e.g. "Kind") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "CancelSurveyReason") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Kind") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "CancelSurveyReason") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *TracksListResponse) MarshalJSON() ([]byte, error) { - type NoMethod TracksListResponse +func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionCancelSurveyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// User: A user resource. -type User struct { - // AccessState: Output only. The state of the user's access to the Play - // Console. - // - // Possible values: - // "ACCESS_STATE_UNSPECIFIED" - Unknown or unspecified access state. - // "INVITED" - User is invited but has not yet accepted the - // invitation. - // "INVITATION_EXPIRED" - Invitation has expired. - // "ACCESS_GRANTED" - User has accepted an invitation and has access - // to the Play Console. - // "ACCESS_EXPIRED" - Account access has expired. - AccessState string `json:"accessState,omitempty"` +// SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the +// data needed to defer a subscription purchase to a future expiry time. +type SubscriptionDeferralInfo struct { + // DesiredExpiryTimeMillis: The desired next expiry time to assign to + // the subscription, in milliseconds since the Epoch. The given time + // must be later/greater than the current expiry time for the + // subscription. + DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"` - // DeveloperAccountPermissions: Permissions for the user which apply - // across the developer account. - // - // Possible values: - // "DEVELOPER_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified - // permission. - // "CAN_SEE_ALL_APPS" - View app information and download bulk reports - // (read-only). - // "CAN_VIEW_FINANCIAL_DATA_GLOBAL" - View financial data, orders, and - // cancellation survey responses. - // "CAN_MANAGE_PERMISSIONS_GLOBAL" - Admin (all permissions). - // "CAN_EDIT_GAMES_GLOBAL" - Edit Play Games Services projects. - // "CAN_PUBLISH_GAMES_GLOBAL" - Publish Play Games Services projects. - // "CAN_REPLY_TO_REVIEWS_GLOBAL" - Reply to reviews. - // "CAN_MANAGE_PUBLIC_APKS_GLOBAL" - Release to production, exclude - // devices, and use app signing by Google Play. - // "CAN_MANAGE_TRACK_APKS_GLOBAL" - Release to testing tracks. - // "CAN_MANAGE_TRACK_USERS_GLOBAL" - Manage testing tracks and edit - // tester lists. - // "CAN_MANAGE_PUBLIC_LISTING_GLOBAL" - Manage store presence. - // "CAN_MANAGE_DRAFT_APPS_GLOBAL" - Create, edit, and delete draft - // apps. - // "CAN_CREATE_MANAGED_PLAY_APPS_GLOBAL" - Create and publish private - // apps to your organization. - // "CAN_CHANGE_MANAGED_PLAY_SETTING_GLOBAL" - Choose whether apps are - // public, or only available to your organization. - // "CAN_MANAGE_ORDERS_GLOBAL" - Manage orders and subscriptions. - DeveloperAccountPermissions []string `json:"developerAccountPermissions,omitempty"` + // ExpectedExpiryTimeMillis: The expected expiry time for the + // subscription. If the current expiry time for the subscription is not + // the value specified here, the deferral will not occur. + ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"` - // Email: Immutable. The user's email address. - Email string `json:"email,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "DesiredExpiryTimeMillis") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` - // ExpirationTime: The time at which the user's access expires, if set. - // When setting this value, it must always be in the future. - ExpirationTime string `json:"expirationTime,omitempty"` + // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Grants: Output only. Per-app permissions for the user. - Grants []*Grant `json:"grants,omitempty"` +func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionDeferralInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Name: Required. Resource name for this user, following the pattern - // "developers/{developer}/users/{email}". - Name string `json:"name,omitempty"` +// SubscriptionListing: The consumer-visible metadata of a subscription. +type SubscriptionListing struct { + // Benefits: A list of benefits shown to the user on platforms such as + // the Play Store and in restoration flows in the language of this + // listing. Plain text. Ordered list of at most four benefits. + Benefits []string `json:"benefits,omitempty"` - // Partial: Output only. Whether there are more permissions for the user - // that are not represented here. This can happen if the caller does not - // have permission to manage all apps in the account. This is also - // `true` if this user is the account owner. If this field is `true`, it - // should be taken as a signal that this user cannot be fully managed - // via the API. That is, the API caller is not be able to manage all of - // the permissions this user holds, either because it doesn't know about - // them or because the user is the account owner. - Partial bool `json:"partial,omitempty"` + // Description: The description of this subscription in the language of + // this listing. Maximum length - 80 characters. Plain text. + Description string `json:"description,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // LanguageCode: Required. The language of this listing, as defined by + // BCP-47, e.g. "en-US". + LanguageCode string `json:"languageCode,omitempty"` - // ForceSendFields is a list of field names (e.g. "AccessState") to + // Title: Required. The title of this subscription in the language of + // this listing. Plain text. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Benefits") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3911,74 +4252,83 @@ type User struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AccessState") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Benefits") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *User) MarshalJSON() ([]byte, error) { - type NoMethod User +func (s *SubscriptionListing) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionListing raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UserComment: User entry from conversation between user and developer. -type UserComment struct { - // AndroidOsVersion: Integer Android SDK version of the user's device at - // the time the review was written, e.g. 23 is Marshmallow. May be - // absent. - AndroidOsVersion int64 `json:"androidOsVersion,omitempty"` - - // AppVersionCode: Integer version code of the app as installed at the - // time the review was written. May be absent. - AppVersionCode int64 `json:"appVersionCode,omitempty"` - - // AppVersionName: String version name of the app as installed at the - // time the review was written. May be absent. - AppVersionName string `json:"appVersionName,omitempty"` +// SubscriptionOffer: A single, temporary offer +type SubscriptionOffer struct { + // BasePlanId: Required. Immutable. The ID of the base plan to which + // this offer is an extension. + BasePlanId string `json:"basePlanId,omitempty"` - // Device: Codename for the reviewer's device, e.g. klte, flounder. May - // be absent. - Device string `json:"device,omitempty"` + // OfferId: Required. Immutable. Unique ID of this subscription offer. + // Must be unique within the base plan. + OfferId string `json:"offerId,omitempty"` - // DeviceMetadata: Information about the characteristics of the user's - // device. - DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"` + // OfferTags: List of up to 20 custom tags specified for this offer, and + // returned to the app through the billing library. + OfferTags []*OfferTag `json:"offerTags,omitempty"` - // LastModified: The last time at which this comment was updated. - LastModified *Timestamp `json:"lastModified,omitempty"` + // OtherRegionsConfig: The configuration for any new locations Play may + // launch in the future. + OtherRegionsConfig *OtherRegionsSubscriptionOfferConfig `json:"otherRegionsConfig,omitempty"` - // OriginalText: Untranslated text of the review, where the review was - // translated. If the review was not translated this is left blank. - OriginalText string `json:"originalText,omitempty"` + // PackageName: Required. Immutable. The package name of the app the + // parent subscription belongs to. + PackageName string `json:"packageName,omitempty"` - // ReviewerLanguage: Language code for the reviewer. This is taken from - // the device settings so is not guaranteed to match the language the - // review is written in. May be absent. - ReviewerLanguage string `json:"reviewerLanguage,omitempty"` + // Phases: Required. The phases of this subscription offer. Must contain + // at least one entry, and may contain at most five. Users will always + // receive all these phases in the specified order. Phases may not be + // added, removed, or reordered after initial creation. + Phases []*SubscriptionOfferPhase `json:"phases,omitempty"` - // StarRating: The star rating associated with the review, from 1 to 5. - StarRating int64 `json:"starRating,omitempty"` + // ProductId: Required. Immutable. The ID of the parent subscription + // this offer belongs to. + ProductId string `json:"productId,omitempty"` - // Text: The content of the comment, i.e. review body. In some cases - // users have been able to write a review with separate title and body; - // in those cases the title and body are concatenated and separated by a - // tab character. - Text string `json:"text,omitempty"` + // RegionalConfigs: Required. The region-specific configuration of this + // offer. Must contain at least one entry. + RegionalConfigs []*RegionalSubscriptionOfferConfig `json:"regionalConfigs,omitempty"` - // ThumbsDownCount: Number of users who have given this review a thumbs - // down. - ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"` + // State: Output only. The current state of this offer. Can be changed + // using Activate and Deactivate actions. NB: the base plan state + // supersedes this state, so an active offer may not be available if the + // base plan is not active. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value, should never be used. + // "DRAFT" - The subscription offer is not and has never been + // available to users. + // "ACTIVE" - The subscription offer is available to new and existing + // users. + // "INACTIVE" - The subscription offer is not available to new users. + // Existing users retain access. + State string `json:"state,omitempty"` + + // Targeting: The requirements that users need to fulfil to be eligible + // for this offer. Represents the requirements that Play will evaluate + // to decide whether an offer should be returned. Developers may further + // filter these offers themselves. + Targeting *SubscriptionOfferTargeting `json:"targeting,omitempty"` - // ThumbsUpCount: Number of users who have given this review a thumbs - // up. - ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to + // ForceSendFields is a list of field names (e.g. "BasePlanId") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3986,32 +4336,42 @@ type UserComment struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AndroidOsVersion") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "BasePlanId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *UserComment) MarshalJSON() ([]byte, error) { - type NoMethod UserComment +func (s *SubscriptionOffer) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionOffer raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// UsesPermission: A permission used by this APK. -type UsesPermission struct { - // MaxSdkVersion: Optionally, the maximum SDK version for which the - // permission is required. - MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"` +// SubscriptionOfferPhase: A single phase of a subscription offer. +type SubscriptionOfferPhase struct { + // Duration: Required. The duration of a single recurrence of this + // phase. Specified in ISO 8601 format. + Duration string `json:"duration,omitempty"` - // Name: The name of the permission requested. - Name string `json:"name,omitempty"` + // OtherRegionsConfig: Pricing information for any new locations Play + // may launch in. + OtherRegionsConfig *OtherRegionsSubscriptionOfferPhaseConfig `json:"otherRegionsConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to + // RecurrenceCount: Required. The number of times this phase repeats. If + // this offer phase is not free, each recurrence charges the user the + // price of this offer phase. + RecurrenceCount int64 `json:"recurrenceCount,omitempty"` + + // RegionalConfigs: Required. The region-specific configuration of this + // offer phase. This list must contain exactly one entry for each region + // for which the subscription offer has a regional config. + RegionalConfigs []*RegionalSubscriptionOfferPhaseConfig `json:"regionalConfigs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Duration") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4019,36 +4379,76 @@ type UsesPermission struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "MaxSdkVersion") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Duration") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *UsesPermission) MarshalJSON() ([]byte, error) { - type NoMethod UsesPermission +func (s *SubscriptionOfferPhase) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionOfferPhase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Variant: APK that is suitable for inclusion in a system image. The -// resource of SystemApksService. -type Variant struct { - // DeviceSpec: The device spec used to generate the APK. - DeviceSpec *DeviceSpec `json:"deviceSpec,omitempty"` +// SubscriptionOfferTargeting: Defines the rule a user needs to satisfy +// to receive this offer. +type SubscriptionOfferTargeting struct { + // AcquisitionRule: Offer targeting rule for new user acquisition. + AcquisitionRule *AcquisitionTargetingRule `json:"acquisitionRule,omitempty"` - // VariantId: Output only. The ID of a previously created system APK - // variant. - VariantId int64 `json:"variantId,omitempty"` + // UpgradeRule: Offer targeting rule for upgrading users' existing + // plans. + UpgradeRule *UpgradeTargetingRule `json:"upgradeRule,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AcquisitionRule") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // ForceSendFields is a list of field names (e.g. "DeviceSpec") to + // NullFields is a list of field names (e.g. "AcquisitionRule") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionOfferTargeting) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionOfferTargeting + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionPriceChange: Contains the price change information for a +// subscription that can be used to control the user journey for the +// price change in the app. This can be in the form of seeking +// confirmation from the user or tailoring the experience for a +// successful conversion. +type SubscriptionPriceChange struct { + // NewPrice: The new price the subscription will renew with if the price + // change is accepted by the user. + NewPrice *Price `json:"newPrice,omitempty"` + + // State: The current state of the price change. Possible values are: 0. + // Outstanding: State for a pending price change waiting for the user to + // agree. In this state, you can optionally seek confirmation from the + // user using the In-App API. 1. Accepted: State for an accepted price + // change that the subscription will renew with unless it's canceled. + // The price change takes effect on a future date when the subscription + // renews. Note that the change might not occur when the subscription is + // renewed next. + State int64 `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NewPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4056,7 +4456,7 @@ type Variant struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DeviceSpec") to include in + // NullFields is a list of field names (e.g. "NewPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -4065,47 +4465,224 @@ type Variant struct { NullFields []string `json:"-"` } -func (s *Variant) MarshalJSON() ([]byte, error) { - type NoMethod Variant +func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPriceChange raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// VoidedPurchase: A VoidedPurchase resource indicates a purchase that -// was either canceled/refunded/charged-back. -type VoidedPurchase struct { - // Kind: This kind represents a voided purchase object in the - // androidpublisher service. - Kind string `json:"kind,omitempty"` - - // OrderId: The order id which uniquely identifies a one-time purchase, - // subscription purchase, or subscription renewal. - OrderId string `json:"orderId,omitempty"` - - // PurchaseTimeMillis: The time at which the purchase was made, in - // milliseconds since the epoch (Jan 1, 1970). - PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` +// SubscriptionPurchase: A SubscriptionPurchase resource indicates the +// status of a user's subscription purchase. +type SubscriptionPurchase struct { + // AcknowledgementState: The acknowledgement state of the subscription + // product. Possible values are: 0. Yet to be acknowledged 1. + // Acknowledged + AcknowledgementState int64 `json:"acknowledgementState,omitempty"` - // PurchaseToken: The token which uniquely identifies a one-time - // purchase or subscription. To uniquely identify subscription renewals - // use order_id (available starting from version 3 of the API). - PurchaseToken string `json:"purchaseToken,omitempty"` + // AutoRenewing: Whether the subscription will automatically be renewed + // when it reaches its current expiry time. + AutoRenewing bool `json:"autoRenewing,omitempty"` - // VoidedReason: The reason why the purchase was voided, possible values - // are: 0. Other 1. Remorse 2. Not_received 3. Defective 4. - // Accidental_purchase 5. Fraud 6. Friendly_fraud 7. Chargeback - VoidedReason int64 `json:"voidedReason,omitempty"` + // AutoResumeTimeMillis: Time at which the subscription will be + // automatically resumed, in milliseconds since the Epoch. Only present + // if the user has requested to pause the subscription. + AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis,omitempty,string"` - // VoidedSource: The initiator of voided purchase, possible values are: - // 0. User 1. Developer 2. Google - VoidedSource int64 `json:"voidedSource,omitempty"` + // CancelReason: The reason why a subscription was canceled or is not + // auto-renewing. Possible values are: 0. User canceled the subscription + // 1. Subscription was canceled by the system, for example because of a + // billing problem 2. Subscription was replaced with a new subscription + // 3. Subscription was canceled by the developer + CancelReason int64 `json:"cancelReason,omitempty"` - // VoidedTimeMillis: The time at which the purchase was - // canceled/refunded/charged-back, in milliseconds since the epoch (Jan - // 1, 1970). - VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"` + // CancelSurveyResult: Information provided by the user when they + // complete the subscription cancellation flow (cancellation reason + // survey). + CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"` - // ForceSendFields is a list of field names (e.g. "Kind") to + // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the + // user at the time the subscription was granted. + CountryCode string `json:"countryCode,omitempty"` + + // DeveloperPayload: A developer-specified string that contains + // supplemental information about an order. + DeveloperPayload string `json:"developerPayload,omitempty"` + + // EmailAddress: The email address of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + EmailAddress string `json:"emailAddress,omitempty"` + + // ExpiryTimeMillis: Time at which the subscription will expire, in + // milliseconds since the Epoch. + ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"` + + // ExternalAccountId: User account identifier in the third-party + // service. Only present if account linking happened as part of the + // subscription purchase flow. + ExternalAccountId string `json:"externalAccountId,omitempty"` + + // FamilyName: The family name of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + GivenName string `json:"givenName,omitempty"` + + // IntroductoryPriceInfo: Introductory price information of the + // subscription. This is only present when the subscription was + // purchased with an introductory price. This field does not indicate + // the subscription is currently in introductory price period. + IntroductoryPriceInfo *IntroductoryPriceInfo `json:"introductoryPriceInfo,omitempty"` + + // Kind: This kind represents a subscriptionPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // LinkedPurchaseToken: The purchase token of the originating purchase + // if this subscription is one of the following: 0. Re-signup of a + // canceled but non-lapsed subscription 1. Upgrade/downgrade from a + // previous subscription For example, suppose a user originally signs up + // and you receive purchase token X, then the user cancels and goes + // through the resignup flow (before their subscription lapses) and you + // receive purchase token Y, and finally the user upgrades their + // subscription and you receive purchase token Z. If you call this API + // with purchase token Z, this field will be set to Y. If you call this + // API with purchase token Y, this field will be set to X. If you call + // this API with purchase token X, this field will not be set. + LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` + + // ObfuscatedExternalAccountId: An obfuscated version of the id that is + // uniquely associated with the user's account in your app. Present for + // the following purchases: * If account linking happened as part of the + // subscription purchase flow. * It was specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid + // when the purchase was made. + ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` + + // ObfuscatedExternalProfileId: An obfuscated version of the id that is + // uniquely associated with the user's profile in your app. Only present + // if specified using + // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid + // when the purchase was made. + ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` + + // OrderId: The order id of the latest recurring order associated with + // the purchase of the subscription. If the subscription was canceled + // because payment was declined, this will be the order id from the + // payment declined order. + OrderId string `json:"orderId,omitempty"` + + // PaymentState: The payment state of the subscription. Possible values + // are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending + // deferred upgrade/downgrade Not present for canceled, expired + // subscriptions. + PaymentState int64 `json:"paymentState,omitempty"` + + // PriceAmountMicros: Price of the subscription, For tax exclusive + // countries, the price doesn't include tax. For tax inclusive + // countries, the price includes tax. Price is expressed in micro-units, + // where 1,000,000 micro-units represents one unit of the currency. For + // example, if the subscription price is €1.99, price_amount_micros is + // 1990000. + PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"` + + // PriceChange: The latest price change information available. This is + // present only when there is an upcoming price change for the + // subscription yet to be applied. Once the subscription renews with the + // new price or the subscription is canceled, no price change + // information will be returned. + PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"` + + // PriceCurrencyCode: ISO 4217 currency code for the subscription price. + // For example, if the price is specified in British pounds sterling, + // price_currency_code is "GBP". + PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"` + + // ProfileId: The Google profile id of the user when the subscription + // was purchased. Only present for purchases made with 'Subscribe with + // Google'. + ProfileId string `json:"profileId,omitempty"` + + // ProfileName: The profile name of the user when the subscription was + // purchased. Only present for purchases made with 'Subscribe with + // Google'. + ProfileName string `json:"profileName,omitempty"` + + // PromotionCode: The promotion code applied on this purchase. This + // field is only set if a vanity code promotion is applied when the + // subscription was purchased. + PromotionCode string `json:"promotionCode,omitempty"` + + // PromotionType: The type of promotion applied on this purchase. This + // field is only set if a promotion is applied when the subscription was + // purchased. Possible values are: 0. One time code 1. Vanity code + PromotionType int64 `json:"promotionType,omitempty"` + + // PurchaseType: The type of purchase of the subscription. This field is + // only set if this purchase was not made using the standard in-app + // billing flow. Possible values are: 0. Test (i.e. purchased from a + // license testing account) 1. Promo (i.e. purchased using a promo code) + PurchaseType *int64 `json:"purchaseType,omitempty"` + + // StartTimeMillis: Time at which the subscription was granted, in + // milliseconds since the Epoch. + StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + + // UserCancellationTimeMillis: The time at which the subscription was + // canceled by the user, in milliseconds since the epoch. Only present + // if cancelReason is 0. + UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AcknowledgementState") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AcknowledgementState") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchase + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionPurchaseLineItem: Item-level info for a subscription +// purchase. +type SubscriptionPurchaseLineItem struct { + // AutoRenewingPlan: The item is auto renewing. + AutoRenewingPlan *AutoRenewingPlan `json:"autoRenewingPlan,omitempty"` + + // ExpiryTime: Time at which the subscription expired or will expire + // unless the access is extended (ex. renews). + ExpiryTime string `json:"expiryTime,omitempty"` + + // PrepaidPlan: The item is prepaid. + PrepaidPlan *PrepaidPlan `json:"prepaidPlan,omitempty"` + + // ProductId: The purchased product ID (for example, 'monthly001'). + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoRenewingPlan") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -4113,92 +4690,4074 @@ type VoidedPurchase struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Kind") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AutoRenewingPlan") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionPurchaseLineItem) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchaseLineItem + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionPurchaseV2: Indicates the status of a user's subscription +// purchase. +type SubscriptionPurchaseV2 struct { + // AcknowledgementState: The acknowledgement state of the subscription. + // + // Possible values: + // "ACKNOWLEDGEMENT_STATE_UNSPECIFIED" - Unspecified acknowledgement + // state. + // "ACKNOWLEDGEMENT_STATE_PENDING" - The subscription is not + // acknowledged yet. + // "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED" - The subscription is + // acknowledged. + AcknowledgementState string `json:"acknowledgementState,omitempty"` + + // CanceledStateContext: Additional context around canceled + // subscriptions. Only present if the subscription currently has + // subscription_state SUBSCRIPTION_STATE_CANCELED. + CanceledStateContext *CanceledStateContext `json:"canceledStateContext,omitempty"` + + // ExternalAccountIdentifiers: User account identifier in the + // third-party service. + ExternalAccountIdentifiers *ExternalAccountIdentifiers `json:"externalAccountIdentifiers,omitempty"` + + // Kind: This kind represents a SubscriptionPurchaseV2 object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // LatestOrderId: The order id of the latest order associated with the + // purchase of the subscription. For autoRenewing subscription, this is + // the order id of signup order if it is not renewed yet, or the last + // recurring order id (success, pending, or declined order). For prepaid + // subscription, this is the order id associated with the queried + // purchase token. + LatestOrderId string `json:"latestOrderId,omitempty"` + + // LineItems: Item-level info for a subscription purchase. The items in + // the same purchase should be either all with AutoRenewingPlan or all + // with PrepaidPlan. + LineItems []*SubscriptionPurchaseLineItem `json:"lineItems,omitempty"` + + // LinkedPurchaseToken: The purchase token of the old subscription if + // this subscription is one of the following: * Re-signup of a canceled + // but non-lapsed subscription * Upgrade/downgrade from a previous + // subscription. * Convert from prepaid to auto renewing subscription. * + // Convert from an auto renewing subscription to prepaid. * Topup a + // prepaid subscription. + LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` + + // PausedStateContext: Additional context around paused subscriptions. + // Only present if the subscription currently has subscription_state + // SUBSCRIPTION_STATE_PAUSED. + PausedStateContext *PausedStateContext `json:"pausedStateContext,omitempty"` + + // RegionCode: ISO 3166-1 alpha-2 billing country/region code of the + // user at the time the subscription was granted. + RegionCode string `json:"regionCode,omitempty"` + + // StartTime: Time at which the subscription was granted. Not set for + // pending subscriptions (subscription was created but awaiting payment + // during signup). + StartTime string `json:"startTime,omitempty"` + + // SubscribeWithGoogleInfo: User profile associated with purchases made + // with 'Subscribe with Google'. + SubscribeWithGoogleInfo *SubscribeWithGoogleInfo `json:"subscribeWithGoogleInfo,omitempty"` + + // SubscriptionState: The current state of the subscription. + // + // Possible values: + // "SUBSCRIPTION_STATE_UNSPECIFIED" - Unspecified subscription state. + // "SUBSCRIPTION_STATE_PENDING" - Subscription was created but + // awaiting payment during signup. In this state, all items are awaiting + // payment. + // "SUBSCRIPTION_STATE_ACTIVE" - Subscription is active. - (1) If the + // subscription is an auto renewing plan, at least one item is + // auto_renew_enabled and not expired. - (2) If the subscription is a + // prepaid plan, at least one item is not expired. + // "SUBSCRIPTION_STATE_PAUSED" - Subscription is paused. The state is + // only available when the subscription is an auto renewing plan. In + // this state, all items are in paused state. + // "SUBSCRIPTION_STATE_IN_GRACE_PERIOD" - Subscription is in grace + // period. The state is only available when the subscription is an auto + // renewing plan. In this state, all items are in grace period. + // "SUBSCRIPTION_STATE_ON_HOLD" - Subscription is on hold (suspended). + // The state is only available when the subscription is an auto renewing + // plan. In this state, all items are on hold. + // "SUBSCRIPTION_STATE_CANCELED" - Subscription is canceled but not + // expired yet. The state is only available when the subscription is an + // auto renewing plan. All items have auto_renew_enabled set to false. + // "SUBSCRIPTION_STATE_EXPIRED" - Subscription is expired. All items + // have expiry_time in the past. + SubscriptionState string `json:"subscriptionState,omitempty"` + + // TestPurchase: Only present if this subscription purchase is a test + // purchase. + TestPurchase *TestPurchase `json:"testPurchase,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AcknowledgementState") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AcknowledgementState") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionPurchaseV2) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchaseV2 + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionPurchasesAcknowledgeRequest: Request for the +// purchases.subscriptions.acknowledge API. +type SubscriptionPurchasesAcknowledgeRequest struct { + // DeveloperPayload: Payload to attach to the purchase. + DeveloperPayload string `json:"developerPayload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeveloperPayload") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchasesAcknowledgeRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionPurchasesDeferRequest: Request for the +// purchases.subscriptions.defer API. +type SubscriptionPurchasesDeferRequest struct { + // DeferralInfo: The information about the new desired expiry time for + // the subscription. + DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeferralInfo") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeferralInfo") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchasesDeferRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionPurchasesDeferResponse: Response for the +// purchases.subscriptions.defer API. +type SubscriptionPurchasesDeferResponse struct { + // NewExpiryTimeMillis: The new expiry time for the subscription in + // milliseconds since the Epoch. + NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionPurchasesDeferResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SubscriptionTaxAndComplianceSettings: Details about taxation, Google +// Play policy and legal compliance for subscription products. +type SubscriptionTaxAndComplianceSettings struct { + // EeaWithdrawalRightType: Digital content or service classification for + // products distributed to users in the European Economic Area (EEA). + // The withdrawal regime under EEA consumer laws depends on this + // classification. Refer to the Help Center article + // (https://support.google.com/googleplay/android-developer/answer/10463498) + // for more information. + // + // Possible values: + // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" + // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" + // "WITHDRAWAL_RIGHT_SERVICE" + EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` + + // TaxRateInfoByRegionCode: A mapping from region code to tax rate + // details. The keys are region codes as defined by Unicode's "CLDR". + TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "EeaWithdrawalRightType") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SubscriptionTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionTaxAndComplianceSettings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SystemApksListResponse: Response to list previously created system +// APK variants. +type SystemApksListResponse struct { + // Variants: All system APK variants created. + Variants []*Variant `json:"variants,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Variants") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Variants") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SystemApksListResponse) MarshalJSON() ([]byte, error) { + type NoMethod SystemApksListResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SystemFeature: Representation of a system feature. +type SystemFeature struct { + // Name: The name of the feature. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SystemFeature) MarshalJSON() ([]byte, error) { + type NoMethod SystemFeature + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SystemInitiatedCancellation: Information specific to cancellations +// initiated by Google system. +type SystemInitiatedCancellation struct { +} + +// TargetingRuleScope: Defines the scope of subscriptions which a +// targeting rule can match to target offers to users based on past or +// current entitlement. +type TargetingRuleScope struct { + // SpecificSubscriptionInApp: The scope of the current targeting rule is + // the subscription with the specified subscription ID. Must be a + // subscription within the same parent app. + SpecificSubscriptionInApp string `json:"specificSubscriptionInApp,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "SpecificSubscriptionInApp") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "SpecificSubscriptionInApp") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. However, any field with an empty value appearing in + // NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TargetingRuleScope) MarshalJSON() ([]byte, error) { + type NoMethod TargetingRuleScope + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TestPurchase: Whether this subscription purchase is a test purchase. +type TestPurchase struct { +} + +// Testers: The testers of an app. The resource for TestersService. +// Note: while it is possible in the Play Console UI to add testers via +// email lists, email lists are not supported by this resource. +type Testers struct { + // GoogleGroups: All testing Google Groups, as email addresses. + GoogleGroups []string `json:"googleGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "GoogleGroups") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "GoogleGroups") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Testers) MarshalJSON() ([]byte, error) { + type NoMethod Testers + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Timestamp: A Timestamp represents a point in time independent of any +// time zone or local calendar, encoded as a count of seconds and +// fractions of seconds at nanosecond resolution. The count is relative +// to an epoch at UTC midnight on January 1, 1970. +type Timestamp struct { + // Nanos: Non-negative fractions of a second at nanosecond resolution. + // Must be from 0 to 999,999,999 inclusive. + Nanos int64 `json:"nanos,omitempty"` + + // Seconds: Represents seconds of UTC time since Unix epoch. + Seconds int64 `json:"seconds,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Nanos") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Nanos") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Timestamp) MarshalJSON() ([]byte, error) { + type NoMethod Timestamp + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TokenPagination: Pagination information returned by a List operation +// when token pagination is enabled. List operations that supports +// paging return only one "page" of results. This protocol buffer +// message describes the page that has been returned. When using token +// pagination, clients should use the next/previous token to get another +// page of the result. The presence or absence of next/previous token +// indicates whether a next/previous page is available and provides a +// mean of accessing this page. ListRequest.page_token should be set to +// either next_page_token or previous_page_token to access another page. +type TokenPagination struct { + // NextPageToken: Tokens to pass to the standard list field + // 'page_token'. Whenever available, tokens are preferred over + // manipulating start_index. + NextPageToken string `json:"nextPageToken,omitempty"` + + PreviousPageToken string `json:"previousPageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TokenPagination) MarshalJSON() ([]byte, error) { + type NoMethod TokenPagination + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Track: A track configuration. The resource for TracksService. +type Track struct { + // Releases: In a read request, represents all active releases in the + // track. In an update request, represents desired changes. + Releases []*TrackRelease `json:"releases,omitempty"` + + // Track: Identifier of the track. + Track string `json:"track,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Releases") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Releases") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Track) MarshalJSON() ([]byte, error) { + type NoMethod Track + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TrackCountryAvailability: Resource for per-track country availability +// information. +type TrackCountryAvailability struct { + // Countries: A list of one or more countries where artifacts in this + // track are available. This list includes all countries that are + // targeted by the track, even if only specific carriers are targeted in + // that country. + Countries []*TrackTargetedCountry `json:"countries,omitempty"` + + // RestOfWorld: Whether artifacts in this track are available to "rest + // of the world" countries. + RestOfWorld bool `json:"restOfWorld,omitempty"` + + // SyncWithProduction: Whether this track's availability is synced with + // the default production track. See + // https://support.google.com/googleplay/android-developer/answer/7550024 + // for more information on syncing country availability with production. + // Note that if this is true, the returned "countries" and + // "rest_of_world" fields will reflect the values for the default + // production track. + SyncWithProduction bool `json:"syncWithProduction,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Countries") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TrackCountryAvailability) MarshalJSON() ([]byte, error) { + type NoMethod TrackCountryAvailability + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TrackRelease: A release within a track. +type TrackRelease struct { + // CountryTargeting: Restricts a release to a specific set of countries. + CountryTargeting *CountryTargeting `json:"countryTargeting,omitempty"` + + // InAppUpdatePriority: In-app update priority of the release. All newly + // added APKs in the release will be considered at this priority. Can + // take values in the range [0, 5], with 5 the highest priority. + // Defaults to 0. in_app_update_priority can not be updated once the + // release is rolled out. See + // https://developer.android.com/guide/playcore/in-app-updates. + InAppUpdatePriority int64 `json:"inAppUpdatePriority,omitempty"` + + // Name: The release name. Not required to be unique. If not set, the + // name is generated from the APK's version_name. If the release + // contains multiple APKs, the name is generated from the date. + Name string `json:"name,omitempty"` + + // ReleaseNotes: A description of what is new in this release. + ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"` + + // Status: The status of the release. + // + // Possible values: + // "statusUnspecified" - Unspecified status. + // "draft" - The release's APKs are not being served to users. + // "inProgress" - The release's APKs are being served to a fraction of + // users, determined by 'user_fraction'. + // "halted" - The release's APKs will no longer be served to users. + // Users who already have these APKs are unaffected. + // "completed" - The release will have no further changes. Its APKs + // are being served to all users, unless they are eligible to APKs of a + // more recent release. + Status string `json:"status,omitempty"` + + // UserFraction: Fraction of users who are eligible for a staged + // release. 0 < fraction < 1. Can only be set when status is + // "inProgress" or "halted". + UserFraction float64 `json:"userFraction,omitempty"` + + // VersionCodes: Version codes of all APKs in the release. Must include + // version codes to retain from previous releases. + VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryTargeting") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CountryTargeting") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *TrackRelease) MarshalJSON() ([]byte, error) { + type NoMethod TrackRelease + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *TrackRelease) UnmarshalJSON(data []byte) error { + type NoMethod TrackRelease + var s1 struct { + UserFraction gensupport.JSONFloat64 `json:"userFraction"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.UserFraction = float64(s1.UserFraction) + return nil +} + +// TrackTargetedCountry: Representation of a single country where the +// contents of a track are available. +type TrackTargetedCountry struct { + // CountryCode: The country to target, as a two-letter CLDR code. + CountryCode string `json:"countryCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CountryCode") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TrackTargetedCountry) MarshalJSON() ([]byte, error) { + type NoMethod TrackTargetedCountry + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TracksListResponse: Response listing all tracks. +type TracksListResponse struct { + // Kind: The kind of this response + // ("androidpublisher#tracksListResponse"). + Kind string `json:"kind,omitempty"` + + // Tracks: All tracks. + Tracks []*Track `json:"tracks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Kind") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TracksListResponse) MarshalJSON() ([]byte, error) { + type NoMethod TracksListResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UpgradeTargetingRule: Represents a targeting rule of the form: User +// currently has {scope} [with billing period {billing_period}]. +type UpgradeTargetingRule struct { + // BillingPeriodDuration: The specific billing period duration, + // specified in ISO 8601 format, that a user must be currently + // subscribed to to be eligible for this rule. If not specified, users + // subscribed to any billing period are matched. + BillingPeriodDuration string `json:"billingPeriodDuration,omitempty"` + + // OncePerUser: Limit this offer to only once per user. If set to true, + // a user can never be eligible for this offer again if they ever + // subscribed to this offer. + OncePerUser bool `json:"oncePerUser,omitempty"` + + // Scope: Required. The scope of subscriptions this rule considers. Only + // allows "this subscription" and "specific subscription in app". + Scope *TargetingRuleScope `json:"scope,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BillingPeriodDuration") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UpgradeTargetingRule) MarshalJSON() ([]byte, error) { + type NoMethod UpgradeTargetingRule + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// User: A user resource. +type User struct { + // AccessState: Output only. The state of the user's access to the Play + // Console. + // + // Possible values: + // "ACCESS_STATE_UNSPECIFIED" - Unknown or unspecified access state. + // "INVITED" - User is invited but has not yet accepted the + // invitation. + // "INVITATION_EXPIRED" - Invitation has expired. + // "ACCESS_GRANTED" - User has accepted an invitation and has access + // to the Play Console. + // "ACCESS_EXPIRED" - Account access has expired. + AccessState string `json:"accessState,omitempty"` + + // DeveloperAccountPermissions: Permissions for the user which apply + // across the developer account. + // + // Possible values: + // "DEVELOPER_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified + // permission. + // "CAN_SEE_ALL_APPS" - View app information and download bulk reports + // (read-only). + // "CAN_VIEW_FINANCIAL_DATA_GLOBAL" - View financial data, orders, and + // cancellation survey responses. + // "CAN_MANAGE_PERMISSIONS_GLOBAL" - Admin (all permissions). + // "CAN_EDIT_GAMES_GLOBAL" - Edit Play Games Services projects. + // "CAN_PUBLISH_GAMES_GLOBAL" - Publish Play Games Services projects. + // "CAN_REPLY_TO_REVIEWS_GLOBAL" - Reply to reviews. + // "CAN_MANAGE_PUBLIC_APKS_GLOBAL" - Release to production, exclude + // devices, and use app signing by Google Play. + // "CAN_MANAGE_TRACK_APKS_GLOBAL" - Release to testing tracks. + // "CAN_MANAGE_TRACK_USERS_GLOBAL" - Manage testing tracks and edit + // tester lists. + // "CAN_MANAGE_PUBLIC_LISTING_GLOBAL" - Manage store presence. + // "CAN_MANAGE_DRAFT_APPS_GLOBAL" - Create, edit, and delete draft + // apps. + // "CAN_CREATE_MANAGED_PLAY_APPS_GLOBAL" - Create and publish private + // apps to your organization. + // "CAN_CHANGE_MANAGED_PLAY_SETTING_GLOBAL" - Choose whether apps are + // public, or only available to your organization. + // "CAN_MANAGE_ORDERS_GLOBAL" - Manage orders and subscriptions. + DeveloperAccountPermissions []string `json:"developerAccountPermissions,omitempty"` + + // Email: Immutable. The user's email address. + Email string `json:"email,omitempty"` + + // ExpirationTime: The time at which the user's access expires, if set. + // When setting this value, it must always be in the future. + ExpirationTime string `json:"expirationTime,omitempty"` + + // Grants: Output only. Per-app permissions for the user. + Grants []*Grant `json:"grants,omitempty"` + + // Name: Required. Resource name for this user, following the pattern + // "developers/{developer}/users/{email}". + Name string `json:"name,omitempty"` + + // Partial: Output only. Whether there are more permissions for the user + // that are not represented here. This can happen if the caller does not + // have permission to manage all apps in the account. This is also + // `true` if this user is the account owner. If this field is `true`, it + // should be taken as a signal that this user cannot be fully managed + // via the API. That is, the API caller is not be able to manage all of + // the permissions this user holds, either because it doesn't know about + // them or because the user is the account owner. + Partial bool `json:"partial,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessState") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AccessState") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type NoMethod User + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserComment: User entry from conversation between user and developer. +type UserComment struct { + // AndroidOsVersion: Integer Android SDK version of the user's device at + // the time the review was written, e.g. 23 is Marshmallow. May be + // absent. + AndroidOsVersion int64 `json:"androidOsVersion,omitempty"` + + // AppVersionCode: Integer version code of the app as installed at the + // time the review was written. May be absent. + AppVersionCode int64 `json:"appVersionCode,omitempty"` + + // AppVersionName: String version name of the app as installed at the + // time the review was written. May be absent. + AppVersionName string `json:"appVersionName,omitempty"` + + // Device: Codename for the reviewer's device, e.g. klte, flounder. May + // be absent. + Device string `json:"device,omitempty"` + + // DeviceMetadata: Information about the characteristics of the user's + // device. + DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"` + + // LastModified: The last time at which this comment was updated. + LastModified *Timestamp `json:"lastModified,omitempty"` + + // OriginalText: Untranslated text of the review, where the review was + // translated. If the review was not translated this is left blank. + OriginalText string `json:"originalText,omitempty"` + + // ReviewerLanguage: Language code for the reviewer. This is taken from + // the device settings so is not guaranteed to match the language the + // review is written in. May be absent. + ReviewerLanguage string `json:"reviewerLanguage,omitempty"` + + // StarRating: The star rating associated with the review, from 1 to 5. + StarRating int64 `json:"starRating,omitempty"` + + // Text: The content of the comment, i.e. review body. In some cases + // users have been able to write a review with separate title and body; + // in those cases the title and body are concatenated and separated by a + // tab character. + Text string `json:"text,omitempty"` + + // ThumbsDownCount: Number of users who have given this review a thumbs + // down. + ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"` + + // ThumbsUpCount: Number of users who have given this review a thumbs + // up. + ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AndroidOsVersion") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UserComment) MarshalJSON() ([]byte, error) { + type NoMethod UserComment + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserInitiatedCancellation: Information specific to cancellations +// initiated by users. +type UserInitiatedCancellation struct { + // CancelSurveyResult: Information provided by the user when they + // complete the subscription cancellation flow (cancellation reason + // survey). + CancelSurveyResult *CancelSurveyResult `json:"cancelSurveyResult,omitempty"` + + // CancelTime: The time at which the subscription was canceled by the + // user. The user might still have access to the subscription after this + // time. Use line_items.expiry_time to determine if a user still has + // access. + CancelTime string `json:"cancelTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CancelSurveyResult") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CancelSurveyResult") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *UserInitiatedCancellation) MarshalJSON() ([]byte, error) { + type NoMethod UserInitiatedCancellation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UsesPermission: A permission used by this APK. +type UsesPermission struct { + // MaxSdkVersion: Optionally, the maximum SDK version for which the + // permission is required. + MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"` + + // Name: The name of the permission requested. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MaxSdkVersion") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UsesPermission) MarshalJSON() ([]byte, error) { + type NoMethod UsesPermission + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Variant: APK that is suitable for inclusion in a system image. The +// resource of SystemApksService. +type Variant struct { + // DeviceSpec: The device spec used to generate the APK. + DeviceSpec *DeviceSpec `json:"deviceSpec,omitempty"` + + // VariantId: Output only. The ID of a previously created system APK + // variant. + VariantId int64 `json:"variantId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DeviceSpec") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeviceSpec") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Variant) MarshalJSON() ([]byte, error) { + type NoMethod Variant + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// VoidedPurchase: A VoidedPurchase resource indicates a purchase that +// was either canceled/refunded/charged-back. +type VoidedPurchase struct { + // Kind: This kind represents a voided purchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // OrderId: The order id which uniquely identifies a one-time purchase, + // subscription purchase, or subscription renewal. + OrderId string `json:"orderId,omitempty"` + + // PurchaseTimeMillis: The time at which the purchase was made, in + // milliseconds since the epoch (Jan 1, 1970). + PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` + + // PurchaseToken: The token which uniquely identifies a one-time + // purchase or subscription. To uniquely identify subscription renewals + // use order_id (available starting from version 3 of the API). + PurchaseToken string `json:"purchaseToken,omitempty"` + + // VoidedReason: The reason why the purchase was voided, possible values + // are: 0. Other 1. Remorse 2. Not_received 3. Defective 4. + // Accidental_purchase 5. Fraud 6. Friendly_fraud 7. Chargeback + VoidedReason int64 `json:"voidedReason,omitempty"` + + // VoidedSource: The initiator of voided purchase, possible values are: + // 0. User 1. Developer 2. Google + VoidedSource int64 `json:"voidedSource,omitempty"` + + // VoidedTimeMillis: The time at which the purchase was + // canceled/refunded/charged-back, in milliseconds since the epoch (Jan + // 1, 1970). + VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Kind") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *VoidedPurchase) MarshalJSON() ([]byte, error) { + type NoMethod VoidedPurchase + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// VoidedPurchasesListResponse: Response for the voidedpurchases.list +// API. +type VoidedPurchasesListResponse struct { + // PageInfo: General pagination information. + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // TokenPagination: Pagination information for token pagination. + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PageInfo") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PageInfo") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) { + type NoMethod VoidedPurchasesListResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "androidpublisher.applications.deviceTierConfigs.create": + +type ApplicationsDeviceTierConfigsCreateCall struct { + s *Service + packageName string + devicetierconfig *DeviceTierConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new device tier config for an app. +// +// - packageName: Package name of the app. +func (r *ApplicationsDeviceTierConfigsService) Create(packageName string, devicetierconfig *DeviceTierConfig) *ApplicationsDeviceTierConfigsCreateCall { + c := &ApplicationsDeviceTierConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.devicetierconfig = devicetierconfig + return c +} + +// AllowUnknownDevices sets the optional parameter +// "allowUnknownDevices": Whether the service should accept device IDs +// that are unknown to Play's device catalog. +func (c *ApplicationsDeviceTierConfigsCreateCall) AllowUnknownDevices(allowUnknownDevices bool) *ApplicationsDeviceTierConfigsCreateCall { + c.urlParams_.Set("allowUnknownDevices", fmt.Sprint(allowUnknownDevices)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsDeviceTierConfigsCreateCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ApplicationsDeviceTierConfigsCreateCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ApplicationsDeviceTierConfigsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ApplicationsDeviceTierConfigsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicetierconfig) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.applications.deviceTierConfigs.create" call. +// Exactly one of *DeviceTierConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeviceTierConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeviceTierConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new device tier config for an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "httpMethod": "POST", + // "id": "androidpublisher.applications.deviceTierConfigs.create", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "allowUnknownDevices": { + // "description": "Whether the service should accept device IDs that are unknown to Play's device catalog.", + // "location": "query", + // "type": "boolean" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "request": { + // "$ref": "DeviceTierConfig" + // }, + // "response": { + // "$ref": "DeviceTierConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.applications.deviceTierConfigs.get": + +type ApplicationsDeviceTierConfigsGetCall struct { + s *Service + packageName string + deviceTierConfigId int64 + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns a particular device tier config. +// +// - deviceTierConfigId: Id of an existing device tier config. +// - packageName: Package name of the app. +func (r *ApplicationsDeviceTierConfigsService) Get(packageName string, deviceTierConfigId int64) *ApplicationsDeviceTierConfigsGetCall { + c := &ApplicationsDeviceTierConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.deviceTierConfigId = deviceTierConfigId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsDeviceTierConfigsGetCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsDeviceTierConfigsGetCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ApplicationsDeviceTierConfigsGetCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ApplicationsDeviceTierConfigsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "deviceTierConfigId": strconv.FormatInt(c.deviceTierConfigId, 10), + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.applications.deviceTierConfigs.get" call. +// Exactly one of *DeviceTierConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeviceTierConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeviceTierConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a particular device tier config.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "httpMethod": "GET", + // "id": "androidpublisher.applications.deviceTierConfigs.get", + // "parameterOrder": [ + // "packageName", + // "deviceTierConfigId" + // ], + // "parameters": { + // "deviceTierConfigId": { + // "description": "Required. Id of an existing device tier config.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "response": { + // "$ref": "DeviceTierConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.applications.deviceTierConfigs.list": + +type ApplicationsDeviceTierConfigsListCall struct { + s *Service + packageName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns created device tier configs, ordered by descending +// creation time. +// +// - packageName: Package name of the app. +func (r *ApplicationsDeviceTierConfigsService) List(packageName string) *ApplicationsDeviceTierConfigsListCall { + c := &ApplicationsDeviceTierConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of device tier configs to return. The service may return fewer than +// this value. If unspecified, at most 10 device tier configs will be +// returned. The maximum value for this field is 100; values above 100 +// will be coerced to 100. Device tier configs will be ordered by +// descending creation time. +func (c *ApplicationsDeviceTierConfigsListCall) PageSize(pageSize int64) *ApplicationsDeviceTierConfigsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListDeviceTierConfigs` call. Provide this +// to retrieve the subsequent page. +func (c *ApplicationsDeviceTierConfigsListCall) PageToken(pageToken string) *ApplicationsDeviceTierConfigsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsDeviceTierConfigsListCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsDeviceTierConfigsListCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ApplicationsDeviceTierConfigsListCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ApplicationsDeviceTierConfigsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.applications.deviceTierConfigs.list" call. +// Exactly one of *ListDeviceTierConfigsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListDeviceTierConfigsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) (*ListDeviceTierConfigsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDeviceTierConfigsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns created device tier configs, ordered by descending creation time.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "httpMethod": "GET", + // "id": "androidpublisher.applications.deviceTierConfigs.list", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of device tier configs to return. The service may return fewer than this value. If unspecified, at most 10 device tier configs will be returned. The maximum value for this field is 100; values above 100 will be coerced to 100. Device tier configs will be ordered by descending creation time.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "response": { + // "$ref": "ListDeviceTierConfigsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ApplicationsDeviceTierConfigsListCall) Pages(ctx context.Context, f func(*ListDeviceTierConfigsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "androidpublisher.edits.commit": + +type EditsCommitCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Commit: Commits an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Commit(packageName string, editId string) *EditsCommitCall { + c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// ChangesNotSentForReview sets the optional parameter +// "changesNotSentForReview": Indicates that the changes in this edit +// will not be reviewed until they are explicitly sent for review from +// the Google Play Console UI. These changes will be added to any other +// changes that are not yet sent for review. +func (c *EditsCommitCall) ChangesNotSentForReview(changesNotSentForReview bool) *EditsCommitCall { + c.urlParams_.Set("changesNotSentForReview", fmt.Sprint(changesNotSentForReview)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsCommitCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.commit" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Commits an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.commit", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "changesNotSentForReview": { + // "description": "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI. These changes will be added to any other changes that are not yet sent for review.", + // "location": "query", + // "type": "boolean" + // }, + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.delete": + +type EditsDeleteCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Delete(packageName string, editId string) *EditsDeleteCall { + c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.delete" call. +func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.delete", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.get": + +type EditsGetCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Get(packageName string, editId string) *EditsGetCall { + c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.get" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.get", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.insert": + +type EditsInsertCall struct { + s *Service + packageName string + appedit *AppEdit + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates a new edit for an app. +// +// - packageName: Package name of the app. +func (r *EditsService) Insert(packageName string, appedit *AppEdit) *EditsInsertCall { + c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.appedit = appedit + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.insert" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new edit for an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.insert", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits", + // "request": { + // "$ref": "AppEdit" + // }, + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.validate": + +type EditsValidateCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Validate: Validates an app edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsService) Validate(packageName string, editId string) *EditsValidateCall { + c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsValidateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.validate" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Validates an app edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.validate", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.addexternallyhosted": + +type EditsApksAddexternallyhostedCall struct { + s *Service + packageName string + editId string + apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Addexternallyhosted: Creates a new APK without uploading the APK +// itself to Google Play, instead hosting the APK at a specified URL. +// This function is only available to organizations using Managed Play +// whose application is configured to restrict distribution to the +// organizations. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsApksService) Addexternallyhosted(packageName string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall { + c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsApksAddexternallyhostedCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.apks.addexternallyhosted" call. +// Exactly one of *ApksAddExternallyHostedResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApksAddExternallyHostedResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.apks.addexternallyhosted", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", + // "request": { + // "$ref": "ApksAddExternallyHostedRequest" + // }, + // "response": { + // "$ref": "ApksAddExternallyHostedResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.list": + +type EditsApksListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all current APKs of the app and edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsApksService) List(packageName string, editId string) *EditsApksListCall { + c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsApksListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.apks.list" call. +// Exactly one of *ApksListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ApksListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApksListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all current APKs of the app and edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.apks.list", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "response": { + // "$ref": "ApksListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.upload": + +type EditsApksUploadCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header +} + +// Upload: Uploads an APK and adds to the current edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsApksService) Upload(packageName string, editId string) *EditsApksUploadCall { + c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsApksUploadCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + req.GetBody = getBody + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.apks.upload" call. +// Exactly one of *Apk or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Apk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &Apk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads an APK and adds to the current edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.apks.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream", + // "application/vnd.android.package-archive" + // ], + // "maxSize": "10737418240", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", + // "response": { + // "$ref": "Apk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "androidpublisher.edits.bundles.list": + +type EditsBundlesListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all current Android App Bundles of the app and edit. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsBundlesService) List(packageName string, editId string) *EditsBundlesListCall { + c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsBundlesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.bundles.list" call. +// Exactly one of *BundlesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BundlesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BundlesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all current Android App Bundles of the app and edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.bundles.list", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "response": { + // "$ref": "BundlesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.bundles.upload": + +type EditsBundlesUploadCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header +} + +// Upload: Uploads a new Android App Bundle to this edit. If you are +// using the Google API client libraries, please increase the timeout of +// the http request before calling this endpoint (a timeout of 2 minutes +// is recommended). See Timeouts and Errors +// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) +// for an example in java. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsBundlesService) Upload(packageName string, editId string) *EditsBundlesUploadCall { + c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// AckBundleInstallationWarning sets the optional parameter +// "ackBundleInstallationWarning": Must be set to true if the app bundle +// installation may trigger a warning on user devices (for example, if +// installation size may be over a threshold, typically 100 MB). +func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall { + c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning)) + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsBundlesUploadCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + req.GetBody = getBody + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.bundles.upload" call. +// Exactly one of *Bundle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bundle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &Bundle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.bundles.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "10737418240", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "ackBundleInstallationWarning": { + // "description": "Must be set to true if the app bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB).", + // "location": "query", + // "type": "boolean" + // }, + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "response": { + // "$ref": "Bundle" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "androidpublisher.edits.countryavailability.get": + +type EditsCountryavailabilityGetCall struct { + s *Service + packageName string + editId string + track string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets country availability. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +// - track: The track to read from. +func (r *EditsCountryavailabilityService) Get(packageName string, editId string, track string) *EditsCountryavailabilityGetCall { + c := &EditsCountryavailabilityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + c.track = track + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsCountryavailabilityGetCall) Fields(s ...googleapi.Field) *EditsCountryavailabilityGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsCountryavailabilityGetCall) IfNoneMatch(entityTag string) *EditsCountryavailabilityGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsCountryavailabilityGetCall) Context(ctx context.Context) *EditsCountryavailabilityGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsCountryavailabilityGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + "track": c.track, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.countryavailability.get" call. +// Exactly one of *TrackCountryAvailability or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TrackCountryAvailability.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*TrackCountryAvailability, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TrackCountryAvailability{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets country availability.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.countryavailability.get", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "description": "The track to read from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", + // "response": { + // "$ref": "TrackCountryAvailability" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.deobfuscationfiles.upload": + +type EditsDeobfuscationfilesUploadCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + deobfuscationFileType string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header +} + +// Upload: Uploads a new deobfuscation file and attaches to the +// specified APK. +// +// - apkVersionCode: The version code of the APK whose Deobfuscation +// File is being uploaded. +// - deobfuscationFileType: The type of the deobfuscation file. +// - editId: Unique identifier for this edit. +// - packageName: Unique identifier for the Android app. +func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall { + c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.deobfuscationFileType = deobfuscationFileType + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + req.GetBody = getBody + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "deobfuscationFileType": c.deobfuscationFileType, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call. +// Exactly one of *DeobfuscationFilesUploadResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &DeobfuscationFilesUploadResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads a new deobfuscation file and attaches to the specified APK.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.deobfuscationfiles.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "629145600", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "deobfuscationFileType" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose Deobfuscation File is being uploaded.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "deobfuscationFileType": { + // "description": "The type of the deobfuscation file.", + // "enum": [ + // "deobfuscationFileTypeUnspecified", + // "proguard", + // "nativeCode" + // ], + // "enumDescriptions": [ + // "Unspecified deobfuscation file type.", + // "Proguard deobfuscation file type.", + // "Native debugging symbols file type." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", + // "response": { + // "$ref": "DeobfuscationFilesUploadResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "androidpublisher.edits.details.get": + +type EditsDetailsGetCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets details of an app. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsDetailsService) Get(packageName string, editId string) *EditsDetailsGetCall { + c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsDetailsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.edits.details.get" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppDetails{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets details of an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.details.get", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "response": { + // "$ref": "AppDetails" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + } -func (s *VoidedPurchase) MarshalJSON() ([]byte, error) { - type NoMethod VoidedPurchase - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} +// method id "androidpublisher.edits.details.patch": -// VoidedPurchasesListResponse: Response for the voidedpurchases.list -// API. -type VoidedPurchasesListResponse struct { - // PageInfo: General pagination information. - PageInfo *PageInfo `json:"pageInfo,omitempty"` +type EditsDetailsPatchCall struct { + s *Service + packageName string + editId string + appdetails *AppDetails + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} - // TokenPagination: Pagination information for token pagination. - TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` +// Patch: Patches details of an app. +// +// - editId: Identifier of the edit. +// - packageName: Package name of the app. +func (r *EditsDetailsService) Patch(packageName string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall { + c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.editId = editId + c.appdetails = appdetails + return c +} - VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"` +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall { + c.ctx_ = ctx + return c +} - // ForceSendFields is a list of field names (e.g. "PageInfo") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *EditsDetailsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} - // NullFields is a list of field names (e.g. "PageInfo") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` +func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } -func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) { - type NoMethod VoidedPurchasesListResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +// Do executes the "androidpublisher.edits.details.patch" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppDetails{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Patches details of an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.details.patch", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "request": { + // "$ref": "AppDetails" + // }, + // "response": { + // "$ref": "AppDetails" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + } -// method id "androidpublisher.applications.deviceTierConfigs.create": +// method id "androidpublisher.edits.details.update": -type ApplicationsDeviceTierConfigsCreateCall struct { - s *Service - packageName string - devicetierconfig *DeviceTierConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsDetailsUpdateCall struct { + s *Service + packageName string + editId string + appdetails *AppDetails + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a new device tier config for an app. +// Update: Updates details of an app. // +// - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *ApplicationsDeviceTierConfigsService) Create(packageName string, devicetierconfig *DeviceTierConfig) *ApplicationsDeviceTierConfigsCreateCall { - c := &ApplicationsDeviceTierConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsDetailsService) Update(packageName string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall { + c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.devicetierconfig = devicetierconfig - return c -} - -// AllowUnknownDevices sets the optional parameter -// "allowUnknownDevices": Whether the service should accept device IDs -// that are unknown to Play's device catalog. -func (c *ApplicationsDeviceTierConfigsCreateCall) AllowUnknownDevices(allowUnknownDevices bool) *ApplicationsDeviceTierConfigsCreateCall { - c.urlParams_.Set("allowUnknownDevices", fmt.Sprint(allowUnknownDevices)) + c.editId = editId + c.appdetails = appdetails return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ApplicationsDeviceTierConfigsCreateCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsCreateCall { +func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4206,21 +8765,21 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Fields(s ...googleapi.Field) * // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ApplicationsDeviceTierConfigsCreateCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsCreateCall { +func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ApplicationsDeviceTierConfigsCreateCall) Header() http.Header { +func (c *EditsDetailsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ApplicationsDeviceTierConfigsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4228,34 +8787,35 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) doRequest(alt string) (*http.R } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicetierconfig) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.applications.deviceTierConfigs.create" call. -// Exactly one of *DeviceTierConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *DeviceTierConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { +// Do executes the "androidpublisher.edits.details.update" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4274,7 +8834,7 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &DeviceTierConfig{ + ret := &AppDetails{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4286,18 +8846,20 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio } return ret, nil // { - // "description": "Creates a new device tier config for an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", - // "httpMethod": "POST", - // "id": "androidpublisher.applications.deviceTierConfigs.create", + // "description": "Updates details of an app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.details.update", // "parameterOrder": [ - // "packageName" + // "packageName", + // "editId" // ], // "parameters": { - // "allowUnknownDevices": { - // "description": "Whether the service should accept device IDs that are unknown to Play's device catalog.", - // "location": "query", - // "type": "boolean" + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", @@ -4306,12 +8868,12 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "request": { - // "$ref": "DeviceTierConfig" + // "$ref": "AppDetails" // }, // "response": { - // "$ref": "DeviceTierConfig" + // "$ref": "AppDetails" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -4320,33 +8882,41 @@ func (c *ApplicationsDeviceTierConfigsCreateCall) Do(opts ...googleapi.CallOptio } -// method id "androidpublisher.applications.deviceTierConfigs.get": +// method id "androidpublisher.edits.expansionfiles.get": -type ApplicationsDeviceTierConfigsGetCall struct { - s *Service - packageName string - deviceTierConfigId int64 - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesGetCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Returns a particular device tier config. +// Get: Fetches the expansion file configuration for the specified APK. // -// - deviceTierConfigId: Id of an existing device tier config. +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. +// - editId: Identifier of the edit. +// - expansionFileType: The file type of the file configuration which is +// being read or modified. // - packageName: Package name of the app. -func (r *ApplicationsDeviceTierConfigsService) Get(packageName string, deviceTierConfigId int64) *ApplicationsDeviceTierConfigsGetCall { - c := &ApplicationsDeviceTierConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsExpansionfilesService) Get(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall { + c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.deviceTierConfigId = deviceTierConfigId + c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ApplicationsDeviceTierConfigsGetCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsGetCall { +func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4356,7 +8926,7 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Fields(s ...googleapi.Field) *App // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ApplicationsDeviceTierConfigsGetCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsGetCall { +func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall { c.ifNoneMatch_ = entityTag return c } @@ -4364,21 +8934,21 @@ func (c *ApplicationsDeviceTierConfigsGetCall) IfNoneMatch(entityTag string) *Ap // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ApplicationsDeviceTierConfigsGetCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsGetCall { +func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ApplicationsDeviceTierConfigsGetCall) Header() http.Header { +func (c *EditsExpansionfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4391,7 +8961,7 @@ func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -4399,20 +8969,22 @@ func (c *ApplicationsDeviceTierConfigsGetCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "deviceTierConfigId": strconv.FormatInt(c.deviceTierConfigId, 10), + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.applications.deviceTierConfigs.get" call. -// Exactly one of *DeviceTierConfig or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *DeviceTierConfig.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.edits.expansionfiles.get" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) (*DeviceTierConfig, error) { +func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4431,7 +9003,7 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &DeviceTierConfig{ + ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4443,18 +9015,42 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Returns a particular device tier config.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "description": "Fetches the expansion file configuration for the specified APK.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "httpMethod": "GET", - // "id": "androidpublisher.applications.deviceTierConfigs.get", + // "id": "androidpublisher.edits.expansionfiles.get", // "parameterOrder": [ // "packageName", - // "deviceTierConfigId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { - // "deviceTierConfigId": { - // "description": "Required. Id of an existing device tier config.", - // "format": "int64", + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "expansionFileType": { + // "description": "The file type of the file configuration which is being read or modified.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], // "location": "path", // "required": true, // "type": "string" @@ -4466,9 +9062,9 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "response": { - // "$ref": "DeviceTierConfig" + // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -4477,115 +9073,104 @@ func (c *ApplicationsDeviceTierConfigsGetCall) Do(opts ...googleapi.CallOption) } -// method id "androidpublisher.applications.deviceTierConfigs.list": +// method id "androidpublisher.edits.expansionfiles.patch": -type ApplicationsDeviceTierConfigsListCall struct { - s *Service - packageName string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesPatchCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + expansionfile *ExpansionFile + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Returns created device tier configs, ordered by descending -// creation time. +// Patch: Patches the APK's expansion file configuration to reference +// another APK's expansion file. To add a new expansion file use the +// Upload method. // +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. +// - editId: Identifier of the edit. +// - expansionFileType: The file type of the expansion file +// configuration which is being updated. // - packageName: Package name of the app. -func (r *ApplicationsDeviceTierConfigsService) List(packageName string) *ApplicationsDeviceTierConfigsListCall { - c := &ApplicationsDeviceTierConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsExpansionfilesService) Patch(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall { + c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of device tier configs to return. The service may return fewer than -// this value. If unspecified, at most 10 device tier configs will be -// returned. The maximum value for this field is 100; values above 100 -// will be coerced to 100. Device tier configs will be ordered by -// descending creation time. -func (c *ApplicationsDeviceTierConfigsListCall) PageSize(pageSize int64) *ApplicationsDeviceTierConfigsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token, -// received from a previous `ListDeviceTierConfigs` call. Provide this -// to retrieve the subsequent page. -func (c *ApplicationsDeviceTierConfigsListCall) PageToken(pageToken string) *ApplicationsDeviceTierConfigsListCall { - c.urlParams_.Set("pageToken", pageToken) + c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ApplicationsDeviceTierConfigsListCall) Fields(s ...googleapi.Field) *ApplicationsDeviceTierConfigsListCall { +func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ApplicationsDeviceTierConfigsListCall) IfNoneMatch(entityTag string) *ApplicationsDeviceTierConfigsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ApplicationsDeviceTierConfigsListCall) Context(ctx context.Context) *ApplicationsDeviceTierConfigsListCall { +func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ApplicationsDeviceTierConfigsListCall) Header() http.Header { +func (c *EditsExpansionfilesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ApplicationsDeviceTierConfigsListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/deviceTierConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.applications.deviceTierConfigs.list" call. -// Exactly one of *ListDeviceTierConfigsResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListDeviceTierConfigsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.edits.expansionfiles.patch" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) (*ListDeviceTierConfigsResponse, error) { +func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4604,7 +9189,7 @@ func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListDeviceTierConfigsResponse{ + ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4616,35 +9201,59 @@ func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "Returns created device tier configs, ordered by descending creation time.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", - // "httpMethod": "GET", - // "id": "androidpublisher.applications.deviceTierConfigs.list", + // "description": "Patches the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.expansionfiles.patch", // "parameterOrder": [ - // "packageName" + // "packageName", + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { - // "packageName": { - // "description": "Package name of the app.", + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "pageSize": { - // "description": "The maximum number of device tier configs to return. The service may return fewer than this value. If unspecified, at most 10 device tier configs will be returned. The maximum value for this field is 100; values above 100 will be coerced to 100. Device tier configs will be ordered by descending creation time.", - // "format": "int32", - // "location": "query", - // "type": "integer" + // "expansionFileType": { + // "description": "The file type of the expansion file configuration which is being updated.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" // }, - // "pageToken": { - // "description": "A page token, received from a previous `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page.", - // "location": "query", + // "packageName": { + // "description": "Package name of the app.", + // "location": "path", + // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/deviceTierConfigs", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "request": { + // "$ref": "ExpansionFile" + // }, // "response": { - // "$ref": "ListDeviceTierConfigsResponse" + // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -4653,63 +9262,44 @@ func (c *ApplicationsDeviceTierConfigsListCall) Do(opts ...googleapi.CallOption) } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ApplicationsDeviceTierConfigsListCall) Pages(ctx context.Context, f func(*ListDeviceTierConfigsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "androidpublisher.edits.commit": +// method id "androidpublisher.edits.expansionfiles.update": -type EditsCommitCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesUpdateCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + expansionfile *ExpansionFile + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Commit: Commits an app edit. +// Update: Updates the APK's expansion file configuration to reference +// another APK's expansion file. To add a new expansion file use the +// Upload method. // +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. // - editId: Identifier of the edit. +// - expansionFileType: The file type of the file configuration which is +// being read or modified. // - packageName: Package name of the app. -func (r *EditsService) Commit(packageName string, editId string) *EditsCommitCall { - c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsExpansionfilesService) Update(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall { + c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - return c -} - -// ChangesNotSentForReview sets the optional parameter -// "changesNotSentForReview": Indicates that the changes in this edit -// will not be reviewed until they are explicitly sent for review from -// the Google Play Console UI. These changes will be added to any other -// changes that are not yet sent for review. -func (c *EditsCommitCall) ChangesNotSentForReview(changesNotSentForReview bool) *EditsCommitCall { - c.urlParams_.Set("changesNotSentForReview", fmt.Sprint(changesNotSentForReview)) + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { +func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4717,21 +9307,21 @@ func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall { +func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsCommitCall) Header() http.Header { +func (c *EditsExpansionfilesUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4739,30 +9329,37 @@ func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.commit" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.expansionfiles.update" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4781,7 +9378,7 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &AppEdit{ + ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4793,19 +9390,23 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Commits an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.commit", + // "description": "Updates the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.expansionfiles.update", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { - // "changesNotSentForReview": { - // "description": "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI. These changes will be added to any other changes that are not yet sent for review.", - // "location": "query", - // "type": "boolean" + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" // }, // "editId": { // "description": "Identifier of the edit.", @@ -4813,6 +9414,22 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "required": true, // "type": "string" // }, + // "expansionFileType": { + // "description": "The file type of the file configuration which is being read or modified.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -4820,9 +9437,12 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "request": { + // "$ref": "ExpansionFile" + // }, // "response": { - // "$ref": "AppEdit" + // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -4831,32 +9451,79 @@ func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.delete": +// method id "androidpublisher.edits.expansionfiles.upload": -type EditsDeleteCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsExpansionfilesUploadCall struct { + s *Service + packageName string + editId string + apkVersionCode int64 + expansionFileType string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header } -// Delete: Deletes an app edit. +// Upload: Uploads a new expansion file and attaches to the specified +// APK. // +// - apkVersionCode: The version code of the APK whose expansion file +// configuration is being read or modified. // - editId: Identifier of the edit. +// - expansionFileType: The file type of the expansion file +// configuration which is being updated. // - packageName: Package name of the app. -func (r *EditsService) Delete(packageName string, editId string) *EditsDeleteCall { - c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsExpansionfilesService) Upload(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall { + c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { +func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4864,21 +9531,23 @@ func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDeleteCall) Header() http.Header { +func (c *EditsExpansionfilesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4888,48 +9557,144 @@ func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, + "packageName": c.packageName, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.delete" call. -func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.edits.expansionfiles.upload" call. +// Exactly one of *ExpansionFilesUploadResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return err + return nil, err } - return nil + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &ExpansionFilesUploadResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.delete", + // "description": "Uploads a new expansion file and attaches to the specified APK.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.expansionfiles.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "2147483648", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" + // } + // } + // }, // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "apkVersionCode", + // "expansionFileType" // ], // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose expansion file configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, + // "expansionFileType": { + // "description": "The file type of the expansion file configuration which is being updated.", + // "enum": [ + // "expansionFileTypeUnspecified", + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "Unspecified expansion file type.", + // "Main expansion file.", + // "Patch expansion file." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -4937,88 +9702,89 @@ func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "response": { + // "$ref": "ExpansionFilesUploadResponse" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.edits.get": +// method id "androidpublisher.edits.images.delete": -type EditsGetCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsImagesDeleteCall struct { + s *Service + packageName string + editId string + language string + imageType string + imageId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets an app edit. +// Delete: Deletes the image (specified by id) from the edit. // // - editId: Identifier of the edit. +// - imageId: Unique identifier an image within the set of images +// attached to this edit. +// - imageType: Type of the Image. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsService) Get(packageName string, editId string) *EditsGetCall { - c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsImagesService) Delete(packageName string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall { + c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.language = language + c.imageType = imageType + c.imageId = imageId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall { +func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall { +func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsGetCall) Header() http.Header { +func (c *EditsImagesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -5026,55 +9792,36 @@ func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, + "imageType": c.imageType, + "imageId": c.imageId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.get" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.images.delete" call. +func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &AppEdit{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return err } - return ret, nil + return nil // { - // "description": "Gets an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.get", + // "description": "Deletes the image (specified by id) from the edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.images.delete", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language", + // "imageType", + // "imageId" // ], // "parameters": { // "editId": { @@ -5083,6 +9830,46 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "required": true, // "type": "string" // }, + // "imageId": { + // "description": "Unique identifier an image within the set of images attached to this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "description": "Type of the Image.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -5090,10 +9877,7 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", - // "response": { - // "$ref": "AppEdit" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -5101,31 +9885,42 @@ func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.insert": +// method id "androidpublisher.edits.images.deleteall": -type EditsInsertCall struct { +type EditsImagesDeleteallCall struct { s *Service packageName string - appedit *AppEdit + editId string + language string + imageType string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Insert: Creates a new edit for an app. +// Deleteall: Deletes all images for the specified language and image +// type. Returns an empty response if no images are found. // +// - editId: Identifier of the edit. +// - imageType: Type of the Image. Providing an image type that refers +// to no images is a no-op. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). Providing a language that is +// not supported by the App is a no-op. // - packageName: Package name of the app. -func (r *EditsService) Insert(packageName string, appedit *AppEdit) *EditsInsertCall { - c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsImagesService) Deleteall(packageName string, editId string, language string, imageType string) *EditsImagesDeleteallCall { + c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.appedit = appedit + c.editId = editId + c.language = language + c.imageType = imageType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { +func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5133,21 +9928,21 @@ func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall { +func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsInsertCall) Header() http.Header { +func (c *EditsImagesDeleteallCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5155,34 +9950,32 @@ func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "editId": c.editId, + "language": c.language, + "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.insert" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.images.deleteall" call. +// Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5201,7 +9994,7 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &AppEdit{ + ret := &ImagesDeleteAllResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5213,14 +10006,57 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Creates a new edit for an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.insert", + // "description": "Deletes all images for the specified language and image type. Returns an empty response if no images are found.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.images.deleteall", // "parameterOrder": [ - // "packageName" + // "packageName", + // "editId", + // "language", + // "imageType" // ], // "parameters": { + // "editId": { + // "description": "Identifier of the edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "description": "Type of the Image. Providing an image type that refers to no images is a no-op.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -5228,12 +10064,9 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits", - // "request": { - // "$ref": "AppEdit" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { - // "$ref": "AppEdit" + // "$ref": "ImagesDeleteAllResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -5242,66 +10075,89 @@ func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.validate": +// method id "androidpublisher.edits.images.list": -type EditsValidateCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsImagesListCall struct { + s *Service + packageName string + editId string + language string + imageType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Validate: Validates an app edit. +// List: Lists all images. The response may be empty. // // - editId: Identifier of the edit. +// - imageType: Type of the Image. Providing an image type that refers +// to no images will return an empty response. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). There must be a store +// listing for the specified language. // - packageName: Package name of the app. -func (r *EditsService) Validate(packageName string, editId string) *EditsValidateCall { - c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsImagesService) List(packageName string, editId string, language string, imageType string) *EditsImagesListCall { + c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.language = language + c.imageType = imageType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall { +func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall { +func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsValidateCall) Header() http.Header { +func (c *EditsImagesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -5309,18 +10165,20 @@ func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, + "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.validate" call. -// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *AppEdit.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { +// Do executes the "androidpublisher.edits.images.list" call. +// Exactly one of *ImagesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5339,7 +10197,7 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &AppEdit{ + ret := &ImagesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5351,13 +10209,15 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } return ret, nil // { - // "description": "Validates an app edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.validate", + // "description": "Lists all images. The response may be empty.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.images.list", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language", + // "imageType" // ], // "parameters": { // "editId": { @@ -5366,6 +10226,40 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "required": true, // "type": "string" // }, + // "imageType": { + // "description": "Type of the Image. Providing an image type that refers to no images will return an empty response.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). There must be a store listing for the specified language.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -5373,9 +10267,9 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { - // "$ref": "AppEdit" + // "$ref": "ImagesListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -5384,38 +10278,79 @@ func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { } -// method id "androidpublisher.edits.apks.addexternallyhosted": +// method id "androidpublisher.edits.images.upload": -type EditsApksAddexternallyhostedCall struct { - s *Service - packageName string - editId string - apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsImagesUploadCall struct { + s *Service + packageName string + editId string + language string + imageType string + urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo + ctx_ context.Context + header_ http.Header } -// Addexternallyhosted: Creates a new APK without uploading the APK -// itself to Google Play, instead hosting the APK at a specified URL. -// This function is only available to organizations using Managed Play -// whose application is configured to restrict distribution to the -// organizations. +// Upload: Uploads an image of the specified language and image type, +// and adds to the edit. // // - editId: Identifier of the edit. +// - imageType: Type of the Image. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). Providing a language that is +// not supported by the App is a no-op. // - packageName: Package name of the app. -func (r *EditsApksService) Addexternallyhosted(packageName string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall { - c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsImagesService) Upload(packageName string, editId string, language string, imageType string) *EditsImagesUploadCall { + c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest + c.language = language + c.imageType = imageType + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall { +func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5423,21 +10358,23 @@ func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsAp // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsApksAddexternallyhostedCall) Header() http.Header { +func (c *EditsImagesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5445,35 +10382,43 @@ func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, + "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.apks.addexternallyhosted" call. -// Exactly one of *ApksAddExternallyHostedResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "androidpublisher.edits.images.upload" call. +// Exactly one of *ImagesUploadResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesUploadResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) { +func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5492,7 +10437,24 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ApksAddExternallyHostedResponse{ + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &ImagesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5504,13 +10466,31 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap } return ret, nil // { - // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", + // "description": "Uploads an image of the specified language and image type, and adds to the edit.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "httpMethod": "POST", - // "id": "androidpublisher.edits.apks.addexternallyhosted", + // "id": "androidpublisher.edits.images.upload", + // "mediaUpload": { + // "accept": [ + // "image/*" + // ], + // "maxSize": "15728640", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" + // } + // } + // }, // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language", + // "imageType" // ], // "parameters": { // "editId": { @@ -5519,6 +10499,40 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap // "required": true, // "type": "string" // }, + // "imageType": { + // "description": "Type of the Image.", + // "enum": [ + // "appImageTypeUnspecified", + // "phoneScreenshots", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvScreenshots", + // "wearScreenshots", + // "icon", + // "featureGraphic", + // "tvBanner" + // ], + // "enumDescriptions": [ + // "Unspecified type. Do not use.", + // "Phone screenshot.", + // "Seven inch screenshot.", + // "Ten inch screenshot.", + // "TV screenshot.", + // "Wear screenshot.", + // "Icon.", + // "Feature graphic.", + // "TV banner." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -5526,94 +10540,82 @@ func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*Ap // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", - // "request": { - // "$ref": "ApksAddExternallyHostedRequest" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { - // "$ref": "ApksAddExternallyHostedResponse" + // "$ref": "ImagesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.edits.apks.list": +// method id "androidpublisher.edits.listings.delete": -type EditsApksListCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsListingsDeleteCall struct { + s *Service + packageName string + editId string + language string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all current APKs of the app and edit. +// Delete: Deletes a localized store listing. // // - editId: Identifier of the edit. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsApksService) List(packageName string, editId string) *EditsApksListCall { - c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Delete(packageName string, editId string, language string) *EditsListingsDeleteCall { + c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.language = language return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall { +func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall { +func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsApksListCall) Header() http.Header { +func (c *EditsListingsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -5621,55 +10623,32 @@ func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.apks.list" call. -// Exactly one of *ApksListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ApksListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) { +// Do executes the "androidpublisher.edits.listings.delete" call. +func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ApksListResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return err } - return ret, nil + return nil // { - // "description": "Lists all current APKs of the app and edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.apks.list", + // "description": "Deletes a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.listings.delete", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language" // ], // "parameters": { // "editId": { @@ -5678,6 +10657,12 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, // "required": true, // "type": "string" // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -5685,10 +10670,7 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", - // "response": { - // "$ref": "ApksListResponse" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -5696,70 +10678,32 @@ func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, } -// method id "androidpublisher.edits.apks.upload": +// method id "androidpublisher.edits.listings.deleteall": -type EditsApksUploadCall struct { +type EditsListingsDeleteallCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Upload: Uploads an APK and adds to the current edit. +// Deleteall: Deletes all store listings. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsApksService) Upload(packageName string, editId string) *EditsApksUploadCall { - c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Deleteall(packageName string, editId string) *EditsListingsDeleteallCall { + c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall { +func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5767,23 +10711,21 @@ func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall { +func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsApksUploadCall) Header() http.Header { +func (c *EditsListingsDeleteallCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5793,24 +10735,13 @@ func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, @@ -5818,82 +10749,23 @@ func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.apks.upload" call. -// Exactly one of *Apk or error will be non-nil. Any non-2xx status code -// is an error. Response headers are in either -// *Apk.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { +// Do executes the "androidpublisher.edits.listings.deleteall" call. +func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &Apk{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return err } - return ret, nil + return nil // { - // "description": "Uploads an APK and adds to the current edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.apks.upload", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream", - // "application/vnd.android.package-archive" - // ], - // "maxSize": "10737418240", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" - // } - // } - // }, + // "description": "Deletes all store listings.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.listings.deleteall", // "parameterOrder": [ // "packageName", // "editId" @@ -5912,45 +10784,45 @@ func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", - // "response": { - // "$ref": "Apk" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.bundles.list": +// method id "androidpublisher.edits.listings.get": -type EditsBundlesListCall struct { +type EditsListingsGetCall struct { s *Service packageName string editId string + language string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists all current Android App Bundles of the app and edit. +// Get: Gets a localized store listing. // // - editId: Identifier of the edit. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsBundlesService) List(packageName string, editId string) *EditsBundlesListCall { - c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Get(packageName string, editId string, language string) *EditsListingsGetCall { + c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.language = language return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall { +func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5960,7 +10832,7 @@ func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCal // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall { +func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -5968,21 +10840,21 @@ func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCa // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall { +func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsBundlesListCall) Header() http.Header { +func (c *EditsListingsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5995,7 +10867,7 @@ func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6005,18 +10877,19 @@ func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.bundles.list" call. -// Exactly one of *BundlesListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *BundlesListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) { +// Do executes the "androidpublisher.edits.listings.get" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6035,7 +10908,7 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &BundlesListResponse{ + ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6047,13 +10920,14 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes } return ret, nil // { - // "description": "Lists all current Android App Bundles of the app and edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "description": "Gets a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "httpMethod": "GET", - // "id": "androidpublisher.edits.bundles.list", + // "id": "androidpublisher.edits.listings.get", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "language" // ], // "parameters": { // "editId": { @@ -6062,6 +10936,12 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes // "required": true, // "type": "string" // }, + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -6069,9 +10949,9 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "response": { - // "$ref": "BundlesListResponse" + // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -6080,135 +10960,84 @@ func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListRes } -// method id "androidpublisher.edits.bundles.upload": +// method id "androidpublisher.edits.listings.list": -type EditsBundlesUploadCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type EditsListingsListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Upload: Uploads a new Android App Bundle to this edit. If you are -// using the Google API client libraries, please increase the timeout of -// the http request before calling this endpoint (a timeout of 2 minutes -// is recommended). See Timeouts and Errors -// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) -// for an example in java. +// List: Lists all localized store listings. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsBundlesService) Upload(packageName string, editId string) *EditsBundlesUploadCall { - c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) List(packageName string, editId string) *EditsListingsListCall { + c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } -// AckBundleInstallationWarning sets the optional parameter -// "ackBundleInstallationWarning": Must be set to true if the app bundle -// installation may trigger a warning on user devices (for example, if -// installation size may be over a threshold, typically 100 MB). -func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall { - c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning)) - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall { +func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall { +func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsBundlesUploadCall) Header() http.Header { +func (c *EditsListingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, @@ -6216,14 +11045,14 @@ func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.bundles.upload" call. -// Exactly one of *Bundle or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Bundle.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) { +// Do executes the "androidpublisher.edits.listings.list" call. +// Exactly one of *ListingsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListingsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6238,69 +11067,31 @@ func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, erro if err != nil { return nil, err } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &Bundle{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.bundles.upload", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "10737418240", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" - // } - // } - // }, + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListingsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all localized store listings.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.listings.list", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { - // "ackBundleInstallationWarning": { - // "description": "Must be set to true if the app bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB).", - // "location": "query", - // "type": "boolean" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", @@ -6314,95 +11105,88 @@ func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, erro // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "response": { - // "$ref": "Bundle" + // "$ref": "ListingsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.countryavailability.get": +// method id "androidpublisher.edits.listings.patch": -type EditsCountryavailabilityGetCall struct { - s *Service - packageName string - editId string - track string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsListingsPatchCall struct { + s *Service + packageName string + editId string + language string + listing *Listing + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets country availability. +// Patch: Patches a localized store listing. // // - editId: Identifier of the edit. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -// - track: The track to read from. -func (r *EditsCountryavailabilityService) Get(packageName string, editId string, track string) *EditsCountryavailabilityGetCall { - c := &EditsCountryavailabilityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsListingsService) Patch(packageName string, editId string, language string, listing *Listing) *EditsListingsPatchCall { + c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.track = track + c.language = language + c.listing = listing return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsCountryavailabilityGetCall) Fields(s ...googleapi.Field) *EditsCountryavailabilityGetCall { +func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsCountryavailabilityGetCall) IfNoneMatch(entityTag string) *EditsCountryavailabilityGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsCountryavailabilityGetCall) Context(ctx context.Context) *EditsCountryavailabilityGetCall { +func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsCountryavailabilityGetCall) Header() http.Header { +func (c *EditsListingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -6410,19 +11194,19 @@ func (c *EditsCountryavailabilityGetCall) doRequest(alt string) (*http.Response, googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, - "track": c.track, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.countryavailability.get" call. -// Exactly one of *TrackCountryAvailability or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *TrackCountryAvailability.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*TrackCountryAvailability, error) { +// Do executes the "androidpublisher.edits.listings.patch" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6441,7 +11225,7 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &TrackCountryAvailability{ + ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6453,14 +11237,14 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra } return ret, nil // { - // "description": "Gets country availability.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.countryavailability.get", + // "description": "Patches a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.listings.patch", // "parameterOrder": [ // "packageName", // "editId", - // "track" + // "language" // ], // "parameters": { // "editId": { @@ -6469,22 +11253,25 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, - // "track": { - // "description": "The track to read from.", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "request": { + // "$ref": "Listing" + // }, // "response": { - // "$ref": "TrackCountryAvailability" + // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -6493,78 +11280,38 @@ func (c *EditsCountryavailabilityGetCall) Do(opts ...googleapi.CallOption) (*Tra } -// method id "androidpublisher.edits.deobfuscationfiles.upload": +// method id "androidpublisher.edits.listings.update": -type EditsDeobfuscationfilesUploadCall struct { - s *Service - packageNameid string - editId string - apkVersionCode int64 - deobfuscationFileType string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type EditsListingsUpdateCall struct { + s *Service + packageName string + editId string + language string + listing *Listing + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Upload: Uploads a new deobfuscation file and attaches to the -// specified APK. +// Update: Creates or updates a localized store listing. // -// - apkVersionCode: The version code of the APK whose Deobfuscation -// File is being uploaded. -// - deobfuscationFileType: The type of the deobfuscation file. -// - editId: Unique identifier for this edit. -// - packageName: Unique identifier for the Android app. -func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall { - c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageNameid = packageNameid +// - editId: Identifier of the edit. +// - language: Language localization code (a BCP-47 language tag; for +// example, "de-AT" for Austrian German). +// - packageName: Package name of the app. +func (r *EditsListingsService) Update(packageName string, editId string, language string, listing *Listing) *EditsListingsUpdateCall { + c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.deobfuscationFileType = deobfuscationFileType - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.language = language + c.listing = listing return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall { +func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6572,23 +11319,21 @@ func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsD // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall { +func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header { +func (c *EditsListingsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6596,43 +11341,36 @@ func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Respons } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err - } - req.Header = reqHeaders - req.GetBody = getBody - googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageNameid, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "deobfuscationFileType": c.deobfuscationFileType, + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "editId": c.editId, + "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call. -// Exactly one of *DeobfuscationFilesUploadResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) { +// Do executes the "androidpublisher.edits.listings.update" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6651,24 +11389,7 @@ func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*D if err := googleapi.CheckResponse(res); err != nil { return nil, err } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &DeobfuscationFilesUploadResponse{ + ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6680,108 +11401,80 @@ func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*D } return ret, nil // { - // "description": "Uploads a new deobfuscation file and attaches to the specified APK.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.deobfuscationfiles.upload", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "629145600", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" - // } - // } - // }, + // "description": "Creates or updates a localized store listing.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.listings.update", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "deobfuscationFileType" + // "language" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose Deobfuscation File is being uploaded.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, - // "deobfuscationFileType": { - // "description": "The type of the deobfuscation file.", - // "enum": [ - // "deobfuscationFileTypeUnspecified", - // "proguard", - // "nativeCode" - // ], - // "enumDescriptions": [ - // "Unspecified deobfuscation file type.", - // "Proguard deobfuscation file type.", - // "Native debugging symbols file type." - // ], + // "editId": { + // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "editId": { - // "description": "Unique identifier for this edit.", + // "language": { + // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { - // "description": "Unique identifier for the Android app.", + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "request": { + // "$ref": "Listing" + // }, // "response": { - // "$ref": "DeobfuscationFilesUploadResponse" + // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.details.get": +// method id "androidpublisher.edits.testers.get": -type EditsDetailsGetCall struct { +type EditsTestersGetCall struct { s *Service packageName string editId string + track string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets details of an app. +// Get: Gets testers. Note: Testers resource does not support email +// lists. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsDetailsService) Get(packageName string, editId string) *EditsDetailsGetCall { - c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: The track to read from. +func (r *EditsTestersService) Get(packageName string, editId string, track string) *EditsTestersGetCall { + c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId + c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall { +func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6791,7 +11484,7 @@ func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall { +func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall { c.ifNoneMatch_ = entityTag return c } @@ -6799,21 +11492,21 @@ func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall { +func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDetailsGetCall) Header() http.Header { +func (c *EditsTestersGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6826,7 +11519,7 @@ func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6836,18 +11529,19 @@ func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.details.get" call. -// Exactly one of *AppDetails or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *AppDetails.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { +// Do executes the "androidpublisher.edits.testers.get" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6866,7 +11560,7 @@ func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, err if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &AppDetails{ + ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6878,13 +11572,14 @@ func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, err } return ret, nil // { - // "description": "Gets details of an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "description": "Gets testers. Note: Testers resource does not support email lists.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "httpMethod": "GET", - // "id": "androidpublisher.edits.details.get", + // "id": "androidpublisher.edits.testers.get", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "track" // ], // "parameters": { // "editId": { @@ -6898,11 +11593,17 @@ func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, err // "location": "path", // "required": true, // "type": "string" + // }, + // "track": { + // "description": "The track to read from.", + // "location": "path", + // "required": true, + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "response": { - // "$ref": "AppDetails" + // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -6911,34 +11612,38 @@ func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, err } -// method id "androidpublisher.edits.details.patch": +// method id "androidpublisher.edits.testers.patch": -type EditsDetailsPatchCall struct { +type EditsTestersPatchCall struct { s *Service packageName string editId string - appdetails *AppDetails + track string + testers *Testers urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Patches details of an app. +// Patch: Patches testers. Note: Testers resource does not support email +// lists. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsDetailsService) Patch(packageName string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall { - c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: The track to update. +func (r *EditsTestersService) Patch(packageName string, editId string, track string, testers *Testers) *EditsTestersPatchCall { + c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.appdetails = appdetails + c.track = track + c.testers = testers return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall { +func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6946,21 +11651,21 @@ func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall { +func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDetailsPatchCall) Header() http.Header { +func (c *EditsTestersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6968,14 +11673,14 @@ func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { @@ -6985,18 +11690,19 @@ func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.details.patch" call. -// Exactly one of *AppDetails or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *AppDetails.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { +// Do executes the "androidpublisher.edits.testers.patch" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7015,7 +11721,7 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &AppDetails{ + ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7027,13 +11733,14 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e } return ret, nil // { - // "description": "Patches details of an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "description": "Patches testers. Note: Testers resource does not support email lists.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.details.patch", + // "id": "androidpublisher.edits.testers.patch", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "track" // ], // "parameters": { // "editId": { @@ -7047,14 +11754,20 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e // "location": "path", // "required": true, // "type": "string" + // }, + // "track": { + // "description": "The track to update.", + // "location": "path", + // "required": true, + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "request": { - // "$ref": "AppDetails" + // "$ref": "Testers" // }, // "response": { - // "$ref": "AppDetails" + // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7063,34 +11776,38 @@ func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, e } -// method id "androidpublisher.edits.details.update": +// method id "androidpublisher.edits.testers.update": -type EditsDetailsUpdateCall struct { +type EditsTestersUpdateCall struct { s *Service packageName string editId string - appdetails *AppDetails + track string + testers *Testers urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates details of an app. +// Update: Updates testers. Note: Testers resource does not support +// email lists. // // - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsDetailsService) Update(packageName string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall { - c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: The track to update. +func (r *EditsTestersService) Update(packageName string, editId string, track string, testers *Testers) *EditsTestersUpdateCall { + c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.appdetails = appdetails + c.track = track + c.testers = testers return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall { +func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7098,21 +11815,21 @@ func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall { +func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsDetailsUpdateCall) Header() http.Header { +func (c *EditsTestersUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7120,14 +11837,14 @@ func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { @@ -7137,18 +11854,19 @@ func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.details.update" call. -// Exactly one of *AppDetails or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *AppDetails.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { +// Do executes the "androidpublisher.edits.testers.update" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7167,7 +11885,7 @@ func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &AppDetails{ + ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7179,13 +11897,14 @@ func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, } return ret, nil // { - // "description": "Updates details of an app.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "description": "Updates testers. Note: Testers resource does not support email lists.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "httpMethod": "PUT", - // "id": "androidpublisher.edits.details.update", + // "id": "androidpublisher.edits.testers.update", // "parameterOrder": [ // "packageName", - // "editId" + // "editId", + // "track" // ], // "parameters": { // "editId": { @@ -7199,14 +11918,20 @@ func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, // "location": "path", // "required": true, // "type": "string" + // }, + // "track": { + // "description": "The track to update.", + // "location": "path", + // "required": true, + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "request": { - // "$ref": "AppDetails" + // "$ref": "Testers" // }, // "response": { - // "$ref": "AppDetails" + // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7215,41 +11940,36 @@ func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, } -// method id "androidpublisher.edits.expansionfiles.get": +// method id "androidpublisher.edits.tracks.get": -type EditsExpansionfilesGetCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type EditsTracksGetCall struct { + s *Service + packageName string + editId string + track string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Fetches the expansion file configuration for the specified APK. +// Get: Gets a track. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the file configuration which is -// being read or modified. // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Get(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall { - c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: Identifier of the track. +func (r *EditsTracksService) Get(packageName string, editId string, track string) *EditsTracksGetCall { + c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType + c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall { +func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7259,7 +11979,7 @@ func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansio // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall { +func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall { c.ifNoneMatch_ = entityTag return c } @@ -7267,21 +11987,21 @@ func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansi // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall { +func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesGetCall) Header() http.Header { +func (c *EditsTracksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7294,7 +12014,7 @@ func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -7302,22 +12022,21 @@ func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.get" call. -// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ExpansionFile.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { +// Do executes the "androidpublisher.edits.tracks.get" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7336,7 +12055,7 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ExpansionFile{ + ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7348,56 +12067,38 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio } return ret, nil // { - // "description": "Fetches the expansion file configuration for the specified APK.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "description": "Gets a track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "httpMethod": "GET", - // "id": "androidpublisher.edits.expansionfiles.get", + // "id": "androidpublisher.edits.tracks.get", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "expansionFileType" + // "track" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the file configuration which is being read or modified.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "Identifier of the track.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "response": { - // "$ref": "ExpansionFile" + // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7406,104 +12107,99 @@ func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*Expansio } -// method id "androidpublisher.edits.expansionfiles.patch": +// method id "androidpublisher.edits.tracks.list": -type EditsExpansionfilesPatchCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - expansionfile *ExpansionFile - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsTracksListCall struct { + s *Service + packageName string + editId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Patches the APK's expansion file configuration to reference -// another APK's expansion file. To add a new expansion file use the -// Upload method. +// List: Lists all tracks. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the expansion file -// configuration which is being updated. // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Patch(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall { - c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *EditsTracksService) List(packageName string, editId string) *EditsTracksListCall { + c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType - c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall { +func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall { +func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesPatchCall) Header() http.Header { +func (c *EditsTracksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.patch" call. -// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ExpansionFile.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.edits.tracks.list" call. +// Exactly one of *TracksListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TracksListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { +func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7522,7 +12218,7 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ExpansionFile{ + ret := &TracksListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7534,46 +12230,21 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans } return ret, nil // { - // "description": "Patches the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.expansionfiles.patch", + // "description": "Lists all tracks.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.tracks.list", // "parameterOrder": [ // "packageName", - // "editId", - // "apkVersionCode", - // "expansionFileType" + // "editId" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the expansion file configuration which is being updated.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", @@ -7581,12 +12252,9 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "request": { - // "$ref": "ExpansionFile" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", // "response": { - // "$ref": "ExpansionFile" + // "$ref": "TracksListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7595,44 +12263,37 @@ func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*Expans } -// method id "androidpublisher.edits.expansionfiles.update": +// method id "androidpublisher.edits.tracks.patch": -type EditsExpansionfilesUpdateCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - expansionfile *ExpansionFile - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type EditsTracksPatchCall struct { + s *Service + packageName string + editId string + track string + track2 *Track + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Updates the APK's expansion file configuration to reference -// another APK's expansion file. To add a new expansion file use the -// Upload method. +// Patch: Patches a track. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the file configuration which is -// being read or modified. // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Update(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall { - c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: Identifier of the track. +func (r *EditsTracksService) Patch(packageName string, editId string, track string, track2 *Track) *EditsTracksPatchCall { + c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType - c.expansionfile = expansionfile + c.track = track + c.track2 = track2 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall { +func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7640,21 +12301,21 @@ func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpan // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall { +func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesUpdateCall) Header() http.Header { +func (c *EditsTracksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7662,37 +12323,36 @@ func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.update" call. -// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *ExpansionFile.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { +// Do executes the "androidpublisher.edits.tracks.patch" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7711,7 +12371,7 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ExpansionFile{ + ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7723,59 +12383,41 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan } return ret, nil // { - // "description": "Updates the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.expansionfiles.update", + // "description": "Patches a track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.tracks.patch", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "expansionFileType" + // "track" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the file configuration which is being read or modified.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "Identifier of the track.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "request": { - // "$ref": "ExpansionFile" + // "$ref": "Track" // }, // "response": { - // "$ref": "ExpansionFile" + // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -7784,79 +12426,37 @@ func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Expan } -// method id "androidpublisher.edits.expansionfiles.upload": +// method id "androidpublisher.edits.tracks.update": -type EditsExpansionfilesUploadCall struct { - s *Service - packageName string - editId string - apkVersionCode int64 - expansionFileType string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type EditsTracksUpdateCall struct { + s *Service + packageName string + editId string + track string + track2 *Track + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Upload: Uploads a new expansion file and attaches to the specified -// APK. +// Update: Updates a track. // -// - apkVersionCode: The version code of the APK whose expansion file -// configuration is being read or modified. // - editId: Identifier of the edit. -// - expansionFileType: The file type of the expansion file -// configuration which is being updated. // - packageName: Package name of the app. -func (r *EditsExpansionfilesService) Upload(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall { - c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - track: Identifier of the track. +func (r *EditsTracksService) Update(packageName string, editId string, track string, track2 *Track) *EditsTracksUpdateCall { + c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId - c.apkVersionCode = apkVersionCode - c.expansionFileType = expansionFileType - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) + c.track = track + c.track2 = track2 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall { +func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7864,23 +12464,21 @@ func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpan // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall { +func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsExpansionfilesUploadCall) Header() http.Header { +func (c *EditsTracksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7888,43 +12486,36 @@ func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, e } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), - "expansionFileType": c.expansionFileType, + "packageName": c.packageName, + "editId": c.editId, + "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.expansionfiles.upload" call. -// Exactly one of *ExpansionFilesUploadResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) { +// Do executes the "androidpublisher.edits.tracks.update" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7943,24 +12534,7 @@ func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*Expan if err := googleapi.CheckResponse(res); err != nil { return nil, err } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &ExpansionFilesUploadResponse{ + ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7972,168 +12546,158 @@ func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*Expan } return ret, nil // { - // "description": "Uploads a new expansion file and attaches to the specified APK.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.expansionfiles.upload", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "2147483648", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" - // } - // } - // }, + // "description": "Updates a track.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.tracks.update", // "parameterOrder": [ // "packageName", // "editId", - // "apkVersionCode", - // "expansionFileType" + // "track" // ], // "parameters": { - // "apkVersionCode": { - // "description": "The version code of the APK whose expansion file configuration is being read or modified.", - // "format": "int32", - // "location": "path", - // "required": true, - // "type": "integer" - // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, - // "expansionFileType": { - // "description": "The file type of the expansion file configuration which is being updated.", - // "enum": [ - // "expansionFileTypeUnspecified", - // "main", - // "patch" - // ], - // "enumDescriptions": [ - // "Unspecified expansion file type.", - // "Main expansion file.", - // "Patch expansion file." - // ], + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "track": { + // "description": "Identifier of the track.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "request": { + // "$ref": "Track" + // }, // "response": { - // "$ref": "ExpansionFilesUploadResponse" + // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.images.delete": +// method id "androidpublisher.generatedapks.download": -type EditsImagesDeleteCall struct { - s *Service - packageName string - editId string - language string - imageType string - imageId string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type GeneratedapksDownloadCall struct { + s *Service + packageName string + versionCode int64 + downloadId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the image (specified by id) from the edit. +// Download: Downloads a single signed APK generated from an app bundle. // -// - editId: Identifier of the edit. -// - imageId: Unique identifier an image within the set of images -// attached to this edit. -// - imageType: Type of the Image. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). +// - downloadId: Download ID, which uniquely identifies the APK to +// download. Can be obtained from the response of `generatedapks.list` +// method. // - packageName: Package name of the app. -func (r *EditsImagesService) Delete(packageName string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall { - c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - versionCode: Version code of the app bundle. +func (r *GeneratedapksService) Download(packageName string, versionCode int64, downloadId string) *GeneratedapksDownloadCall { + c := &GeneratedapksDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.language = language - c.imageType = imageType - c.imageId = imageId + c.versionCode = versionCode + c.downloadId = downloadId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall { +func (c *GeneratedapksDownloadCall) Fields(s ...googleapi.Field) *GeneratedapksDownloadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall { +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GeneratedapksDownloadCall) IfNoneMatch(entityTag string) *GeneratedapksDownloadCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download +// methods. Any pending HTTP request will be aborted if the provided +// context is canceled. +func (c *GeneratedapksDownloadCall) Context(ctx context.Context) *GeneratedapksDownloadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesDeleteCall) Header() http.Header { +func (c *GeneratedapksDownloadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "language": c.language, - "imageType": c.imageType, - "imageId": c.imageId, + "versionCode": strconv.FormatInt(c.versionCode, 10), + "downloadId": c.downloadId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.delete" call. -func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *GeneratedapksDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "androidpublisher.generatedapks.download" call. +func (c *GeneratedapksDownloadCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { @@ -8143,172 +12707,142 @@ func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { if err := googleapi.CheckResponse(res); err != nil { return err } - return nil - // { - // "description": "Deletes the image (specified by id) from the edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.images.delete", - // "parameterOrder": [ - // "packageName", - // "editId", - // "language", - // "imageType", - // "imageId" - // ], - // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageId": { - // "description": "Unique identifier an image within the set of images attached to this edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], + return nil + // { + // "description": "Downloads a single signed APK generated from an app bundle.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", + // "httpMethod": "GET", + // "id": "androidpublisher.generatedapks.download", + // "parameterOrder": [ + // "packageName", + // "versionCode", + // "downloadId" + // ], + // "parameters": { + // "downloadId": { + // "description": "Download ID, which uniquely identifies the APK to download. Can be obtained from the response of `generatedapks.list` method.", // "location": "path", // "required": true, // "type": "string" // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "versionCode": { + // "description": "Version code of the app bundle.", + // "format": "int32", // "location": "path", // "required": true, - // "type": "string" + // "type": "integer" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", + // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaDownload": true, + // "useMediaDownloadService": true // } } -// method id "androidpublisher.edits.images.deleteall": +// method id "androidpublisher.generatedapks.list": -type EditsImagesDeleteallCall struct { - s *Service - packageName string - editId string - language string - imageType string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type GeneratedapksListCall struct { + s *Service + packageName string + versionCode int64 + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Deleteall: Deletes all images for the specified language and image -// type. Returns an empty response if no images are found. +// List: Returns download metadata for all APKs that were generated from +// a given app bundle. // -// - editId: Identifier of the edit. -// - imageType: Type of the Image. Providing an image type that refers -// to no images is a no-op. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). Providing a language that is -// not supported by the App is a no-op. // - packageName: Package name of the app. -func (r *EditsImagesService) Deleteall(packageName string, editId string, language string, imageType string) *EditsImagesDeleteallCall { - c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - versionCode: Version code of the app bundle. +func (r *GeneratedapksService) List(packageName string, versionCode int64) *GeneratedapksListCall { + c := &GeneratedapksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.language = language - c.imageType = imageType + c.versionCode = versionCode return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall { +func (c *GeneratedapksListCall) Fields(s ...googleapi.Field) *GeneratedapksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GeneratedapksListCall) IfNoneMatch(entityTag string) *GeneratedapksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall { +func (c *GeneratedapksListCall) Context(ctx context.Context) *GeneratedapksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesDeleteallCall) Header() http.Header { +func (c *GeneratedapksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { +func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "language": c.language, - "imageType": c.imageType, + "versionCode": strconv.FormatInt(c.versionCode, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.deleteall" call. -// Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.generatedapks.list" call. +// Exactly one of *GeneratedApksListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GeneratedApksListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) { +func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8327,7 +12861,7 @@ func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDele if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ImagesDeleteAllResponse{ + ret := &GeneratedApksListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8339,67 +12873,32 @@ func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDele } return ret, nil // { - // "description": "Deletes all images for the specified language and image type. Returns an empty response if no images are found.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.images.deleteall", + // "description": "Returns download metadata for all APKs that were generated from a given app bundle.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", + // "httpMethod": "GET", + // "id": "androidpublisher.generatedapks.list", // "parameterOrder": [ // "packageName", - // "editId", - // "language", - // "imageType" + // "versionCode" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image. Providing an image type that refers to no images is a no-op.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "versionCode": { + // "description": "Version code of the app bundle.", + // "format": "int32", // "location": "path", // "required": true, - // "type": "string" + // "type": "integer" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", // "response": { - // "$ref": "ImagesDeleteAllResponse" + // "$ref": "GeneratedApksListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -8408,110 +12907,89 @@ func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDele } -// method id "androidpublisher.edits.images.list": +// method id "androidpublisher.grants.create": -type EditsImagesListCall struct { - s *Service - packageName string - editId string - language string - imageType string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type GrantsCreateCall struct { + s *Service + parent string + grant *Grant + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all images. The response may be empty. +// Create: Grant access for a user to the given package. // -// - editId: Identifier of the edit. -// - imageType: Type of the Image. Providing an image type that refers -// to no images will return an empty response. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). There must be a store -// listing for the specified language. -// - packageName: Package name of the app. -func (r *EditsImagesService) List(packageName string, editId string, language string, imageType string) *EditsImagesListCall { - c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.language = language - c.imageType = imageType +// - parent: The user which needs permission. Format: +// developers/{developer}/users/{user}. +func (r *GrantsService) Create(parent string, grant *Grant) *GrantsCreateCall { + c := &GrantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.grant = grant return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall { +func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall { +func (c *GrantsCreateCall) Context(ctx context.Context) *GrantsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesListCall) Header() http.Header { +func (c *GrantsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { +func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/grants") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "language": c.language, - "imageType": c.imageType, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.list" call. -// Exactly one of *ImagesListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ImagesListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) { +// Do executes the "androidpublisher.grants.create" call. +// Exactly one of *Grant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Grant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8530,7 +13008,7 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ImagesListResponse{ + ret := &Grant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8542,67 +13020,28 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo } return ret, nil // { - // "description": "Lists all images. The response may be empty.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.images.list", + // "description": "Grant access for a user to the given package.", + // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants", + // "httpMethod": "POST", + // "id": "androidpublisher.grants.create", // "parameterOrder": [ - // "packageName", - // "editId", - // "language", - // "imageType" + // "parent" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image. Providing an image type that refers to no images will return an empty response.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). There must be a store listing for the specified language.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Package name of the app.", + // "parent": { + // "description": "Required. The user which needs permission. Format: developers/{developer}/users/{user}", // "location": "path", + // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "path": "androidpublisher/v3/{+parent}/grants", + // "request": { + // "$ref": "Grant" + // }, // "response": { - // "$ref": "ImagesListResponse" + // "$ref": "Grant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -8611,79 +13050,31 @@ func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListRespo } -// method id "androidpublisher.edits.images.upload": - -type EditsImagesUploadCall struct { - s *Service - packageName string - editId string - language string - imageType string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header -} - -// Upload: Uploads an image of the specified language and image type, -// and adds to the edit. -// -// - editId: Identifier of the edit. -// - imageType: Type of the Image. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). Providing a language that is -// not supported by the App is a no-op. -// - packageName: Package name of the app. -func (r *EditsImagesService) Upload(packageName string, editId string, language string, imageType string) *EditsImagesUploadCall { - c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.language = language - c.imageType = imageType - return c -} +// method id "androidpublisher.grants.delete": -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c +type GrantsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. +// Delete: Removes all access for the user to the given package or +// developer account. // -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c -} - -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall { - c.mediaInfo_.SetProgressUpdater(pu) +// - name: The name of the grant to delete. Format: +// developers/{developer}/users/{email}/grants/{package_name}. +func (r *GrantsService) Delete(name string) *GrantsDeleteCall { + c := &GrantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall { +func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8691,23 +13082,21 @@ func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall { +func (c *GrantsDeleteCall) Context(ctx context.Context) *GrantsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsImagesUploadCall) Header() http.Header { +func (c *GrantsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { +func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8717,204 +13106,91 @@ func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "language": c.language, - "imageType": c.imageType, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.images.upload" call. -// Exactly one of *ImagesUploadResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ImagesUploadResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &ImagesUploadResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Uploads an image of the specified language and image type, and adds to the edit.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", - // "httpMethod": "POST", - // "id": "androidpublisher.edits.images.upload", - // "mediaUpload": { - // "accept": [ - // "image/*" - // ], - // "maxSize": "15728640", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" - // } - // } - // }, +// Do executes the "androidpublisher.grants.delete" call. +func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes all access for the user to the given package or developer account.", + // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.grants.delete", // "parameterOrder": [ - // "packageName", - // "editId", - // "language", - // "imageType" + // "name" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "imageType": { - // "description": "Type of the Image.", - // "enum": [ - // "appImageTypeUnspecified", - // "phoneScreenshots", - // "sevenInchScreenshots", - // "tenInchScreenshots", - // "tvScreenshots", - // "wearScreenshots", - // "icon", - // "featureGraphic", - // "tvBanner" - // ], - // "enumDescriptions": [ - // "Unspecified type. Do not use.", - // "Phone screenshot.", - // "Seven inch screenshot.", - // "Ten inch screenshot.", - // "TV screenshot.", - // "Wear screenshot.", - // "Icon.", - // "Feature graphic.", - // "TV banner." - // ], - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "packageName": { - // "description": "Package name of the app.", + // "name": { + // "description": "Required. The name of the grant to delete. Format: developers/{developer}/users/{email}/grants/{package_name}", // "location": "path", + // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", - // "response": { - // "$ref": "ImagesUploadResponse" - // }, + // "path": "androidpublisher/v3/{+name}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.edits.listings.delete": +// method id "androidpublisher.grants.patch": -type EditsListingsDeleteCall struct { - s *Service - packageName string - editId string - language string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type GrantsPatchCall struct { + s *Service + name string + grant *Grant + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a localized store listing. +// Patch: Updates access for the user to the given package. // -// - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). -// - packageName: Package name of the app. -func (r *EditsListingsService) Delete(packageName string, editId string, language string) *EditsListingsDeleteCall { - c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.editId = editId - c.language = language +// - name: Resource name for this grant, following the pattern +// "developers/{developer}/users/{email}/grants/{package_name}". If +// this grant is for a draft app, the app ID will be used in this +// resource name instead of the package name. +func (r *GrantsService) Patch(name string, grant *Grant) *GrantsPatchCall { + c := &GrantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.grant = grant + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. +func (c *GrantsPatchCall) UpdateMask(updateMask string) *GrantsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall { +func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8922,21 +13198,21 @@ func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall { +func (c *GrantsPatchCall) Context(ctx context.Context) *GrantsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsDeleteCall) Header() http.Header { +func (c *GrantsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8944,66 +13220,93 @@ func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "language": c.language, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.delete" call. -func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.grants.patch" call. +// Exactly one of *Grant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Grant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return err + return nil, err } - return nil + ret := &Grant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Deletes a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.listings.delete", + // "description": "Updates access for the user to the given package.", + // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.grants.patch", // "parameterOrder": [ - // "packageName", - // "editId", - // "language" + // "name" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "name": { + // "description": "Required. Resource name for this grant, following the pattern \"developers/{developer}/users/{email}/grants/{package_name}\". If this grant is for a draft app, the app ID will be used in this resource name instead of the package name.", // "location": "path", + // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, + // "updateMask": { + // "description": "Optional. The list of fields to be updated.", + // "format": "google-fieldmask", + // "location": "query", // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "path": "androidpublisher/v3/{+name}", + // "request": { + // "$ref": "Grant" + // }, + // "response": { + // "$ref": "Grant" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -9011,32 +13314,33 @@ func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.edits.listings.deleteall": +// method id "androidpublisher.inappproducts.delete": -type EditsListingsDeleteallCall struct { +type InappproductsDeleteCall struct { s *Service packageName string - editId string + skuid string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Deleteall: Deletes all store listings. +// Delete: Deletes an in-app product (i.e. a managed product or a +// subscriptions). // -// - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsListingsService) Deleteall(packageName string, editId string) *EditsListingsDeleteallCall { - c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Delete(packageName string, skuid string) *InappproductsDeleteCall { + c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId + c.skuid = skuid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall { +func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9044,21 +13348,21 @@ func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListings // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall { +func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsDeleteallCall) Header() http.Header { +func (c *InappproductsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9068,7 +13372,7 @@ func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -9077,13 +13381,13 @@ func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, erro req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.deleteall" call. -func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.inappproducts.delete" call. +func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { @@ -9095,29 +13399,29 @@ func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { } return nil // { - // "description": "Deletes all store listings.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "description": "Deletes an in-app product (i.e. a managed product or a subscriptions).", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "httpMethod": "DELETE", - // "id": "androidpublisher.edits.listings.deleteall", + // "id": "androidpublisher.inappproducts.delete", // "parameterOrder": [ // "packageName", - // "editId" + // "sku" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -9125,37 +13429,34 @@ func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.edits.listings.get": +// method id "androidpublisher.inappproducts.get": -type EditsListingsGetCall struct { +type InappproductsGetCall struct { s *Service packageName string - editId string - language string + skuid string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets a localized store listing. +// Get: Gets an in-app product, which can be a managed product or a +// subscription. // -// - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsListingsService) Get(packageName string, editId string, language string) *EditsListingsGetCall { - c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall { + c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.language = language + c.skuid = skuid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall { +func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9165,7 +13466,7 @@ func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCal // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall { +func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -9173,21 +13474,21 @@ func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCa // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall { +func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsGetCall) Header() http.Header { +func (c *InappproductsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9200,7 +13501,7 @@ func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9209,20 +13510,19 @@ func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "language": c.language, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.get" call. -// Exactly one of *Listing or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Listing.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) { +// Do executes the "androidpublisher.inappproducts.get" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9241,7 +13541,7 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Listing{ + ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9253,38 +13553,31 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error } return ret, nil // { - // "description": "Gets a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "description": "Gets an in-app product, which can be a managed product or a subscription.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "httpMethod": "GET", - // "id": "androidpublisher.edits.listings.get", + // "id": "androidpublisher.inappproducts.get", // "parameterOrder": [ // "packageName", - // "editId", - // "language" + // "sku" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "response": { - // "$ref": "Listing" + // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9293,99 +13586,99 @@ func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error } -// method id "androidpublisher.edits.listings.list": +// method id "androidpublisher.inappproducts.insert": -type EditsListingsListCall struct { +type InappproductsInsertCall struct { s *Service packageName string - editId string + inappproduct *InAppProduct urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists all localized store listings. +// Insert: Creates an in-app product (i.e. a managed product or a +// subscriptions). // -// - editId: Identifier of the edit. // - packageName: Package name of the app. -func (r *EditsListingsService) List(packageName string, editId string) *EditsListingsListCall { - c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InappproductsService) Insert(packageName string, inappproduct *InAppProduct) *InappproductsInsertCall { + c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId + c.inappproduct = inappproduct + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall { + c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall { +func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall { +func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsListCall) Header() http.Header { +func (c *InappproductsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.list" call. -// Exactly one of *ListingsListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListingsListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) { +// Do executes the "androidpublisher.inappproducts.insert" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9404,7 +13697,7 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListingsListResponse{ + ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9416,20 +13709,18 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR } return ret, nil // { - // "description": "Lists all localized store listings.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.listings.list", + // "description": "Creates an in-app product (i.e. a managed product or a subscriptions).", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "httpMethod": "POST", + // "id": "androidpublisher.inappproducts.insert", // "parameterOrder": [ - // "packageName", - // "editId" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" // }, // "packageName": { // "description": "Package name of the app.", @@ -9438,9 +13729,12 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "request": { + // "$ref": "InAppProduct" + // }, // "response": { - // "$ref": "ListingsListResponse" + // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9449,97 +13743,121 @@ func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListR } -// method id "androidpublisher.edits.listings.patch": +// method id "androidpublisher.inappproducts.list": -type EditsListingsPatchCall struct { - s *Service - packageName string - editId string - language string - listing *Listing - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsListCall struct { + s *Service + packageName string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Patches a localized store listing. +// List: Lists all in-app products - both managed products and +// subscriptions. If an app has a large number of in-app products, the +// response may be paginated. In this case the response field +// `tokenPagination.nextPageToken` will be set and the caller should +// provide its value as a `token` request parameter to retrieve the next +// page. // -// - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsListingsService) Patch(packageName string, editId string, language string, listing *Listing) *EditsListingsPatchCall { - c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InappproductsService) List(packageName string) *InappproductsListCall { + c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.language = language - c.listing = listing + return c +} + +// MaxResults sets the optional parameter "maxResults": Deprecated and +// ignored. The page size is determined by the server. +func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// StartIndex sets the optional parameter "startIndex": Deprecated and +// ignored. Set the `token` parameter to rertieve the next page. +func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall { + c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) + return c +} + +// Token sets the optional parameter "token": Pagination token. If +// empty, list starts at the first product. +func (c *InappproductsListCall) Token(token string) *InappproductsListCall { + c.urlParams_.Set("token", token) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall { +func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall { +func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsPatchCall) Header() http.Header { +func (c *InappproductsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.patch" call. -// Exactly one of *Listing or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Listing.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) { +// Do executes the "androidpublisher.inappproducts.list" call. +// Exactly one of *InappproductsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InappproductsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9558,7 +13876,7 @@ func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, err if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Listing{ + ret := &InappproductsListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9570,41 +13888,41 @@ func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, err } return ret, nil // { - // "description": "Patches a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.listings.patch", + // "description": "Lists all in-app products - both managed products and subscriptions. If an app has a large number of in-app products, the response may be paginated. In this case the response field `tokenPagination.nextPageToken` will be set and the caller should provide its value as a `token` request parameter to retrieve the next page.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "httpMethod": "GET", + // "id": "androidpublisher.inappproducts.list", // "parameterOrder": [ - // "packageName", - // "editId", - // "language" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", - // "location": "path", - // "required": true, - // "type": "string" + // "maxResults": { + // "description": "Deprecated and ignored. The page size is determined by the server.", + // "format": "uint32", + // "location": "query", + // "type": "integer" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" + // }, + // "startIndex": { + // "description": "Deprecated and ignored. Set the `token` parameter to rertieve the next page.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "token": { + // "description": "Pagination token. If empty, list starts at the first product.", + // "location": "query", + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "request": { - // "$ref": "Listing" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", // "response": { - // "$ref": "Listing" + // "$ref": "InappproductsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9613,38 +13931,45 @@ func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, err } -// method id "androidpublisher.edits.listings.update": +// method id "androidpublisher.inappproducts.patch": -type EditsListingsUpdateCall struct { - s *Service - packageName string - editId string - language string - listing *Listing - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InappproductsPatchCall struct { + s *Service + packageName string + skuid string + inappproduct *InAppProduct + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Creates or updates a localized store listing. +// Patch: Patches an in-app product (i.e. a managed product or a +// subscriptions). // -// - editId: Identifier of the edit. -// - language: Language localization code (a BCP-47 language tag; for -// example, "de-AT" for Austrian German). // - packageName: Package name of the app. -func (r *EditsListingsService) Update(packageName string, editId string, language string, listing *Listing) *EditsListingsUpdateCall { - c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Patch(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall { + c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.language = language - c.listing = listing + c.skuid = skuid + c.inappproduct = inappproduct + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall { + c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall { +func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9652,21 +13977,21 @@ func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpd // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall { +func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsListingsUpdateCall) Header() http.Header { +func (c *InappproductsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9674,36 +13999,35 @@ func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "language": c.language, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.listings.update" call. -// Exactly one of *Listing or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Listing.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) { +// Do executes the "androidpublisher.inappproducts.patch" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9722,7 +14046,7 @@ func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, er if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Listing{ + ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9734,41 +14058,39 @@ func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, er } return ret, nil // { - // "description": "Creates or updates a localized store listing.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.listings.update", + // "description": "Patches an in-app product (i.e. a managed product or a subscriptions).", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.inappproducts.patch", // "parameterOrder": [ // "packageName", - // "editId", - // "language" + // "sku" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" // }, - // "language": { - // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", + // "packageName": { + // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "request": { - // "$ref": "Listing" + // "$ref": "InAppProduct" // }, // "response": { - // "$ref": "Listing" + // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9777,104 +14099,111 @@ func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, er } -// method id "androidpublisher.edits.testers.get": +// method id "androidpublisher.inappproducts.update": -type EditsTestersGetCall struct { +type InappproductsUpdateCall struct { s *Service packageName string - editId string - track string + skuid string + inappproduct *InAppProduct urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Gets testers. Note: Testers resource does not support email -// lists. +// Update: Updates an in-app product (i.e. a managed product or a +// subscriptions). // -// - editId: Identifier of the edit. // - packageName: Package name of the app. -// - track: The track to read from. -func (r *EditsTestersService) Get(packageName string, editId string, track string) *EditsTestersGetCall { - c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - sku: Unique identifier for the in-app product. +func (r *InappproductsService) Update(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall { + c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track + c.skuid = skuid + c.inappproduct = inappproduct + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the in-app product with the given package_name and sku +// doesn't exist, the in-app product will be created. +func (c *InappproductsUpdateCall) AllowMissing(allowMissing bool) *InappproductsUpdateCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall { + c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall { +func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall { +func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTestersGetCall) Header() http.Header { +func (c *InappproductsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { +func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, + "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.testers.get" call. -// Exactly one of *Testers or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Testers.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) { +// Do executes the "androidpublisher.inappproducts.update" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9893,7 +14222,7 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Testers{ + ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9905,21 +14234,24 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) } return ret, nil // { - // "description": "Gets testers. Note: Testers resource does not support email lists.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.testers.get", + // "description": "Updates an in-app product (i.e. a managed product or a subscriptions).", + // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "httpMethod": "PUT", + // "id": "androidpublisher.inappproducts.update", // "parameterOrder": [ // "packageName", - // "editId", - // "track" + // "sku" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" + // "allowMissing": { + // "description": "If set to true, and the in-app product with the given package_name and sku doesn't exist, the in-app product will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" // }, // "packageName": { // "description": "Package name of the app.", @@ -9927,16 +14259,19 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) // "required": true, // "type": "string" // }, - // "track": { - // "description": "The track to read from.", + // "sku": { + // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", + // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "request": { + // "$ref": "InAppProduct" + // }, // "response": { - // "$ref": "Testers" + // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -9945,38 +14280,72 @@ func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) } -// method id "androidpublisher.edits.testers.patch": +// method id "androidpublisher.internalappsharingartifacts.uploadapk": -type EditsTestersPatchCall struct { +type InternalappsharingartifactsUploadapkCall struct { s *Service packageName string - editId string - track string - testers *Testers urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Patch: Patches testers. Note: Testers resource does not support email -// lists. +// Uploadapk: Uploads an APK to internal app sharing. If you are using +// the Google API client libraries, please increase the timeout of the +// http request before calling this endpoint (a timeout of 2 minutes is +// recommended). See Timeouts and Errors +// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) +// for an example in java. // -// - editId: Identifier of the edit. // - packageName: Package name of the app. -// - track: The track to update. -func (r *EditsTestersService) Patch(packageName string, editId string, track string, testers *Testers) *EditsTestersPatchCall { - c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InternalappsharingartifactsService) Uploadapk(packageName string) *InternalappsharingartifactsUploadapkCall { + c := &InternalappsharingartifactsUploadapkCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.testers = testers + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *InternalappsharingartifactsUploadapkCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadapkCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *InternalappsharingartifactsUploadapkCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadapkCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *InternalappsharingartifactsUploadapkCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadapkCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall { +func (c *InternalappsharingartifactsUploadapkCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadapkCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9984,21 +14353,23 @@ func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *InternalappsharingartifactsUploadapkCall) Context(ctx context.Context) *InternalappsharingartifactsUploadapkCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTestersPatchCall) Header() http.Header { +func (c *InternalappsharingartifactsUploadapkCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10006,36 +14377,40 @@ func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.testers.patch" call. -// Exactly one of *Testers or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Testers.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) { +// Do executes the "androidpublisher.internalappsharingartifacts.uploadapk" call. +// Exactly one of *InternalAppSharingArtifact or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InternalAppSharingArtifact.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10054,7 +14429,24 @@ func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, erro if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Testers{ + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &InternalAppSharingArtifact{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10066,81 +14458,116 @@ func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, erro } return ret, nil // { - // "description": "Patches testers. Note: Testers resource does not support email lists.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.testers.patch", + // "description": "Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", + // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", + // "httpMethod": "POST", + // "id": "androidpublisher.internalappsharingartifacts.uploadapk", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream", + // "application/vnd.android.package-archive" + // ], + // "maxSize": "1073741824", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" + // } + // } + // }, // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" - // }, - // "track": { - // "description": "The track to update.", - // "location": "path", - // "required": true, - // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "request": { - // "$ref": "Testers" - // }, + // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", // "response": { - // "$ref": "Testers" + // "$ref": "InternalAppSharingArtifact" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.edits.testers.update": +// method id "androidpublisher.internalappsharingartifacts.uploadbundle": -type EditsTestersUpdateCall struct { +type InternalappsharingartifactsUploadbundleCall struct { s *Service packageName string - editId string - track string - testers *Testers urlParams_ gensupport.URLParams + mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } -// Update: Updates testers. Note: Testers resource does not support -// email lists. +// Uploadbundle: Uploads an app bundle to internal app sharing. If you +// are using the Google API client libraries, please increase the +// timeout of the http request before calling this endpoint (a timeout +// of 2 minutes is recommended). See Timeouts and Errors +// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) +// for an example in java. // -// - editId: Identifier of the edit. // - packageName: Package name of the app. -// - track: The track to update. -func (r *EditsTestersService) Update(packageName string, editId string, track string, testers *Testers) *EditsTestersUpdateCall { - c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InternalappsharingartifactsService) Uploadbundle(packageName string) *InternalappsharingartifactsUploadbundleCall { + c := &InternalappsharingartifactsUploadbundleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.testers = testers + return c +} + +// Media specifies the media to upload in one or more chunks. The chunk +// size may be controlled by supplying a MediaOption generated by +// googleapi.ChunkSize. The chunk size defaults to +// googleapi.DefaultUploadChunkSize.The Content-Type header used in the +// upload request will be determined by sniffing the contents of r, +// unless a MediaOption generated by googleapi.ContentType is +// supplied. +// At most one of Media and ResumableMedia may be set. +func (c *InternalappsharingartifactsUploadbundleCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadbundleCall { + c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be +// canceled with ctx. +// +// Deprecated: use Media instead. +// +// At most one of Media and ResumableMedia may be set. mediaType +// identifies the MIME media type of the upload, such as "image/png". If +// mediaType is "", it will be auto-detected. The provided ctx will +// supersede any context previously provided to the Context method. +func (c *InternalappsharingartifactsUploadbundleCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadbundleCall { + c.ctx_ = ctx + c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) + return c +} + +// ProgressUpdater provides a callback function that will be called +// after every chunk. It should be a low-latency function in order to +// not slow down the upload operation. This should only be called when +// using ResumableMedia (as opposed to Media). +func (c *InternalappsharingartifactsUploadbundleCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadbundleCall { + c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall { +func (c *InternalappsharingartifactsUploadbundleCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadbundleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10148,21 +14575,23 @@ func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall { +// This context will supersede any context previously provided to the +// ResumableMedia method. +func (c *InternalappsharingartifactsUploadbundleCall) Context(ctx context.Context) *InternalappsharingartifactsUploadbundleCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTestersUpdateCall) Header() http.Header { +func (c *InternalappsharingartifactsUploadbundleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10170,36 +14599,40 @@ func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") + if c.mediaInfo_ != nil { + urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") + c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) + } + if body == nil { + body = new(bytes.Buffer) + reqHeaders.Set("Content-Type", "application/json") + } + body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) + defer cleanup() urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders + req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.testers.update" call. -// Exactly one of *Testers or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Testers.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) { +// Do executes the "androidpublisher.internalappsharingartifacts.uploadbundle" call. +// Exactly one of *InternalAppSharingArtifact or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InternalAppSharingArtifact.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10218,7 +14651,24 @@ func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, err if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Testers{ + rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) + if rx != nil { + rx.Client = c.s.client + rx.UserAgent = c.s.userAgent() + ctx := c.ctx_ + if ctx == nil { + ctx = context.TODO() + } + res, err = rx.Upload(ctx) + if err != nil { + return nil, err + } + defer res.Body.Close() + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + } + ret := &InternalAppSharingArtifact{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10230,146 +14680,133 @@ func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, err } return ret, nil // { - // "description": "Updates testers. Note: Testers resource does not support email lists.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.testers.update", + // "description": "Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", + // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", + // "httpMethod": "POST", + // "id": "androidpublisher.internalappsharingartifacts.uploadbundle", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "10737418240", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" + // } + // } + // }, // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" - // }, - // "track": { - // "description": "The track to update.", - // "location": "path", - // "required": true, - // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", - // "request": { - // "$ref": "Testers" - // }, + // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", // "response": { - // "$ref": "Testers" + // "$ref": "InternalAppSharingArtifact" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] + // ], + // "supportsMediaUpload": true // } } -// method id "androidpublisher.edits.tracks.get": +// method id "androidpublisher.monetization.convertRegionPrices": -type EditsTracksGetCall struct { - s *Service - packageName string - editId string - track string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationConvertRegionPricesCall struct { + s *Service + packageName string + convertregionpricesrequest *ConvertRegionPricesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a track. +// ConvertRegionPrices: Calculates the region prices, using today's +// exchange rate and country-specific pricing patterns, based on the +// price in the request for a set of regions. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: Identifier of the track. -func (r *EditsTracksService) Get(packageName string, editId string, track string) *EditsTracksGetCall { - c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The app package name. +func (r *MonetizationService) ConvertRegionPrices(packageName string, convertregionpricesrequest *ConvertRegionPricesRequest) *MonetizationConvertRegionPricesCall { + c := &MonetizationConvertRegionPricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track + c.convertregionpricesrequest = convertregionpricesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall { +func (c *MonetizationConvertRegionPricesCall) Fields(s ...googleapi.Field) *MonetizationConvertRegionPricesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall { +func (c *MonetizationConvertRegionPricesCall) Context(ctx context.Context) *MonetizationConvertRegionPricesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksGetCall) Header() http.Header { +func (c *MonetizationConvertRegionPricesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertregionpricesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "track": c.track, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "androidpublisher.edits.tracks.get" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { + "packageName": c.packageName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.monetization.convertRegionPrices" call. +// Exactly one of *ConvertRegionPricesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ConvertRegionPricesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) (*ConvertRegionPricesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10388,7 +14825,7 @@ func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Track{ + ret := &ConvertRegionPricesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10400,38 +14837,27 @@ func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { } return ret, nil // { - // "description": "Gets a track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.tracks.get", + // "description": "Calculates the region prices, using today's exchange rate and country-specific pricing patterns, based on the price in the request for a set of regions.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.convertRegionPrices", // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "track": { - // "description": "Identifier of the track.", + // "description": "Required. The app package name.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "path": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", + // "request": { + // "$ref": "ConvertRegionPricesRequest" + // }, // "response": { - // "$ref": "Track" + // "$ref": "ConvertRegionPricesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -10440,99 +14866,96 @@ func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { } -// method id "androidpublisher.edits.tracks.list": +// method id "androidpublisher.monetization.subscriptions.archive": -type EditsTracksListCall struct { - s *Service - packageName string - editId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsArchiveCall struct { + s *Service + packageName string + productId string + archivesubscriptionrequest *ArchiveSubscriptionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all tracks. +// Archive: Archives a subscription. Can only be done if at least one +// base plan was active in the past, and no base plan is available for +// new or existing subscribers currently. This action is irreversible, +// and the subscription ID will remain reserved. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -func (r *EditsTracksService) List(packageName string, editId string) *EditsTracksListCall { - c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the app of the +// subscription to delete. +// - productId: The unique product ID of the subscription to delete. +func (r *MonetizationSubscriptionsService) Archive(packageName string, productId string, archivesubscriptionrequest *ArchiveSubscriptionRequest) *MonetizationSubscriptionsArchiveCall { + c := &MonetizationSubscriptionsArchiveCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId + c.productId = productId + c.archivesubscriptionrequest = archivesubscriptionrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall { +func (c *MonetizationSubscriptionsArchiveCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsArchiveCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall { +func (c *MonetizationSubscriptionsArchiveCall) Context(ctx context.Context) *MonetizationSubscriptionsArchiveCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksListCall) Header() http.Header { +func (c *MonetizationSubscriptionsArchiveCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsArchiveCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.archivesubscriptionrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, + "productId": c.productId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.list" call. -// Exactly one of *TracksListResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *TracksListResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) { +// Do executes the "androidpublisher.monetization.subscriptions.archive" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsArchiveCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10551,7 +14974,7 @@ func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListRespo if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &TracksListResponse{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10563,31 +14986,34 @@ func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListRespo } return ret, nil // { - // "description": "Lists all tracks.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", - // "httpMethod": "GET", - // "id": "androidpublisher.edits.tracks.list", + // "description": "Archives a subscription. Can only be done if at least one base plan was active in the past, and no base plan is available for new or existing subscribers currently. This action is irreversible, and the subscription ID will remain reserved.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.archive", // "parameterOrder": [ // "packageName", - // "editId" + // "productId" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", + // "packageName": { + // "description": "Required. The parent app (package name) of the app of the subscription to delete.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", + // "productId": { + // "description": "Required. The unique product ID of the subscription to delete.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive", + // "request": { + // "$ref": "ArchiveSubscriptionRequest" + // }, // "response": { - // "$ref": "TracksListResponse" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -10596,37 +15022,51 @@ func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListRespo } -// method id "androidpublisher.edits.tracks.patch": +// method id "androidpublisher.monetization.subscriptions.create": -type EditsTracksPatchCall struct { - s *Service - packageName string - editId string - track string - track2 *Track - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsCreateCall struct { + s *Service + packageName string + subscription *Subscription + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Patches a track. +// Create: Creates a new subscription. Newly added base plans will +// remain in draft state until activated. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: Identifier of the track. -func (r *EditsTracksService) Patch(packageName string, editId string, track string, track2 *Track) *EditsTracksPatchCall { - c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) for which the +// subscription should be created. Must be equal to the package_name +// field on the Subscription resource. +func (r *MonetizationSubscriptionsService) Create(packageName string, subscription *Subscription) *MonetizationSubscriptionsCreateCall { + c := &MonetizationSubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.track2 = track2 + c.subscription = subscription + return c +} + +// ProductId sets the optional parameter "productId": Required. The ID +// to use for the subscription. For the requirements on this format, see +// the documentation of the product_id field on the Subscription +// resource. +func (c *MonetizationSubscriptionsCreateCall) ProductId(productId string) *MonetizationSubscriptionsCreateCall { + c.urlParams_.Set("productId", productId) + return c +} + +// RegionsVersionVersion sets the optional parameter +// "regionsVersion.version": Required. A string representing version of +// the available regions being used for the specified resource. +func (c *MonetizationSubscriptionsCreateCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsCreateCall { + c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall { +func (c *MonetizationSubscriptionsCreateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10634,21 +15074,21 @@ func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCal // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall { +func (c *MonetizationSubscriptionsCreateCall) Context(ctx context.Context) *MonetizationSubscriptionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksPatchCall) Header() http.Header { +func (c *MonetizationSubscriptionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10656,36 +15096,34 @@ func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "editId": c.editId, - "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.edits.tracks.patch" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) { +// Do executes the "androidpublisher.monetization.subscriptions.create" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10704,7 +15142,7 @@ func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Track{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10716,41 +15154,37 @@ func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) } return ret, nil // { - // "description": "Patches a track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.edits.tracks.patch", + // "description": "Creates a new subscription. Newly added base plans will remain in draft state until activated.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.create", // "parameterOrder": [ - // "packageName", - // "editId", - // "track" + // "packageName" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", + // "packageName": { + // "description": "Required. The parent app (package name) for which the subscription should be created. Must be equal to the package_name field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // }, - // "packageName": { - // "description": "Package name of the app.", - // "location": "path", - // "required": true, + // "productId": { + // "description": "Required. The ID to use for the subscription. For the requirements on this format, see the documentation of the product_id field on the Subscription resource.", + // "location": "query", // "type": "string" // }, - // "track": { - // "description": "Identifier of the track.", - // "location": "path", - // "required": true, + // "regionsVersion.version": { + // "description": "Required. A string representing version of the available regions being used for the specified resource.", + // "location": "query", // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions", // "request": { - // "$ref": "Track" + // "$ref": "Subscription" // }, // "response": { - // "$ref": "Track" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -10759,37 +15193,34 @@ func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) } -// method id "androidpublisher.edits.tracks.update": +// method id "androidpublisher.monetization.subscriptions.delete": -type EditsTracksUpdateCall struct { +type MonetizationSubscriptionsDeleteCall struct { s *Service packageName string - editId string - track string - track2 *Track + productId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a track. +// Delete: Deletes a subscription. A subscription can only be deleted if +// it has never had a base plan published. // -// - editId: Identifier of the edit. -// - packageName: Package name of the app. -// - track: Identifier of the track. -func (r *EditsTracksService) Update(packageName string, editId string, track string, track2 *Track) *EditsTracksUpdateCall { - c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the app of the +// subscription to delete. +// - productId: The unique product ID of the subscription to delete. +func (r *MonetizationSubscriptionsService) Delete(packageName string, productId string) *MonetizationSubscriptionsDeleteCall { + c := &MonetizationSubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.editId = editId - c.track = track - c.track2 = track2 + c.productId = productId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall { +func (c *MonetizationSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10797,21 +15228,21 @@ func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateC // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall { +func (c *MonetizationSubscriptionsDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *EditsTracksUpdateCall) Header() http.Header { +func (c *MonetizationSubscriptionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10819,102 +15250,58 @@ func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "packageName": c.packageName, - "editId": c.editId, - "track": c.track, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "androidpublisher.edits.tracks.update" call. -// Exactly one of *Track or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Track.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } + "packageName": c.packageName, + "productId": c.productId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.monetization.subscriptions.delete" call. +func (c *MonetizationSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Track{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return err } - return ret, nil + return nil // { - // "description": "Updates a track.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "httpMethod": "PUT", - // "id": "androidpublisher.edits.tracks.update", + // "description": "Deletes a subscription. A subscription can only be deleted if it has never had a base plan published.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.monetization.subscriptions.delete", // "parameterOrder": [ // "packageName", - // "editId", - // "track" + // "productId" // ], // "parameters": { - // "editId": { - // "description": "Identifier of the edit.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the app of the subscription to delete.", // "location": "path", // "required": true, // "type": "string" // }, - // "track": { - // "description": "Identifier of the track.", + // "productId": { + // "description": "Required. The unique product ID of the subscription to delete.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", - // "request": { - // "$ref": "Track" - // }, - // "response": { - // "$ref": "Track" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -10922,38 +15309,34 @@ func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) } -// method id "androidpublisher.generatedapks.download": +// method id "androidpublisher.monetization.subscriptions.get": -type GeneratedapksDownloadCall struct { +type MonetizationSubscriptionsGetCall struct { s *Service packageName string - versionCode int64 - downloadId string + productId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Download: Downloads a single signed APK generated from an app bundle. +// Get: Reads a single subscription. // -// - downloadId: Download ID, which uniquely identifies the APK to -// download. Can be obtained from the response of `generatedapks.list` -// method. -// - packageName: Package name of the app. -// - versionCode: Version code of the app bundle. -func (r *GeneratedapksService) Download(packageName string, versionCode int64, downloadId string) *GeneratedapksDownloadCall { - c := &GeneratedapksDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) of the subscription to +// get. +// - productId: The unique product ID of the subscription to get. +func (r *MonetizationSubscriptionsService) Get(packageName string, productId string) *MonetizationSubscriptionsGetCall { + c := &MonetizationSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.versionCode = versionCode - c.downloadId = downloadId + c.productId = productId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GeneratedapksDownloadCall) Fields(s ...googleapi.Field) *GeneratedapksDownloadCall { +func (c *MonetizationSubscriptionsGetCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10963,29 +15346,29 @@ func (c *GeneratedapksDownloadCall) Fields(s ...googleapi.Field) *GeneratedapksD // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *GeneratedapksDownloadCall) IfNoneMatch(entityTag string) *GeneratedapksDownloadCall { +func (c *MonetizationSubscriptionsGetCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsGetCall { c.ifNoneMatch_ = entityTag return c } -// Context sets the context to be used in this call's Do and Download -// methods. Any pending HTTP request will be aborted if the provided -// context is canceled. -func (c *GeneratedapksDownloadCall) Context(ctx context.Context) *GeneratedapksDownloadCall { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *MonetizationSubscriptionsGetCall) Context(ctx context.Context) *MonetizationSubscriptionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GeneratedapksDownloadCall) Header() http.Header { +func (c *MonetizationSubscriptionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10998,7 +15381,7 @@ func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11007,109 +15390,134 @@ func (c *GeneratedapksDownloadCall) doRequest(alt string) (*http.Response, error req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "versionCode": strconv.FormatInt(c.versionCode, 10), - "downloadId": c.downloadId, + "productId": c.productId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Download fetches the API endpoint's "media" value, instead of the normal -// API response value. If the returned error is nil, the Response is guaranteed to -// have a 2xx status code. Callers must close the Response.Body as usual. -func (c *GeneratedapksDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { +// Do executes the "androidpublisher.monetization.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("media") + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } + defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - res.Body.Close() return nil, err } - return res, nil -} - -// Do executes the "androidpublisher.generatedapks.download" call. -func (c *GeneratedapksDownloadCall) Do(opts ...googleapi.CallOption) error { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if err != nil { - return err + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return err + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err } - return nil + return ret, nil // { - // "description": "Downloads a single signed APK generated from an app bundle.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", + // "description": "Reads a single subscription.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", // "httpMethod": "GET", - // "id": "androidpublisher.generatedapks.download", + // "id": "androidpublisher.monetization.subscriptions.get", // "parameterOrder": [ // "packageName", - // "versionCode", - // "downloadId" + // "productId" // ], // "parameters": { - // "downloadId": { - // "description": "Download ID, which uniquely identifies the APK to download. Can be obtained from the response of `generatedapks.list` method.", - // "location": "path", - // "required": true, - // "type": "string" - // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the subscription to get.", // "location": "path", // "required": true, // "type": "string" // }, - // "versionCode": { - // "description": "Version code of the app bundle.", - // "format": "int32", + // "productId": { + // "description": "Required. The unique product ID of the subscription to get.", // "location": "path", // "required": true, - // "type": "integer" + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "response": { + // "$ref": "Subscription" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaDownload": true, - // "useMediaDownloadService": true + // ] // } } -// method id "androidpublisher.generatedapks.list": +// method id "androidpublisher.monetization.subscriptions.list": -type GeneratedapksListCall struct { +type MonetizationSubscriptionsListCall struct { s *Service packageName string - versionCode int64 urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns download metadata for all APKs that were generated from -// a given app bundle. +// List: Lists all subscriptions under a given app. // -// - packageName: Package name of the app. -// - versionCode: Version code of the app bundle. -func (r *GeneratedapksService) List(packageName string, versionCode int64) *GeneratedapksListCall { - c := &GeneratedapksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - packageName: The parent app (package name) for which the +// subscriptions should be read. +func (r *MonetizationSubscriptionsService) List(packageName string) *MonetizationSubscriptionsListCall { + c := &MonetizationSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.versionCode = versionCode + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of subscriptions to return. The service may return fewer than this +// value. If unspecified, at most 50 subscriptions will be returned. The +// maximum value is 1000; values above 1000 will be coerced to 1000. +func (c *MonetizationSubscriptionsListCall) PageSize(pageSize int64) *MonetizationSubscriptionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListSubscriptions` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters +// provided to `ListSubscriptions` must match the call that provided the +// page token. +func (c *MonetizationSubscriptionsListCall) PageToken(pageToken string) *MonetizationSubscriptionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ShowArchived sets the optional parameter "showArchived": Whether +// archived subscriptions should be included in the response. Defaults +// to false. +func (c *MonetizationSubscriptionsListCall) ShowArchived(showArchived bool) *MonetizationSubscriptionsListCall { + c.urlParams_.Set("showArchived", fmt.Sprint(showArchived)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GeneratedapksListCall) Fields(s ...googleapi.Field) *GeneratedapksListCall { +func (c *MonetizationSubscriptionsListCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11119,7 +15527,7 @@ func (c *GeneratedapksListCall) Fields(s ...googleapi.Field) *GeneratedapksListC // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *GeneratedapksListCall) IfNoneMatch(entityTag string) *GeneratedapksListCall { +func (c *MonetizationSubscriptionsListCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsListCall { c.ifNoneMatch_ = entityTag return c } @@ -11127,21 +15535,21 @@ func (c *GeneratedapksListCall) IfNoneMatch(entityTag string) *GeneratedapksList // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GeneratedapksListCall) Context(ctx context.Context) *GeneratedapksListCall { +func (c *MonetizationSubscriptionsListCall) Context(ctx context.Context) *MonetizationSubscriptionsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GeneratedapksListCall) Header() http.Header { +func (c *MonetizationSubscriptionsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11154,7 +15562,7 @@ func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -11163,19 +15571,18 @@ func (c *GeneratedapksListCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "versionCode": strconv.FormatInt(c.versionCode, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.generatedapks.list" call. -// Exactly one of *GeneratedApksListResponse or error will be non-nil. +// Do executes the "androidpublisher.monetization.subscriptions.list" call. +// Exactly one of *ListSubscriptionsResponse or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either -// *GeneratedApksListResponse.ServerResponse.Header or (if a response +// *ListSubscriptionsResponse.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApksListResponse, error) { +func (c *MonetizationSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11194,7 +15601,7 @@ func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApks if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &GeneratedApksListResponse{ + ret := &ListSubscriptionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11206,32 +15613,40 @@ func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApks } return ret, nil // { - // "description": "Returns download metadata for all APKs that were generated from a given app bundle.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", + // "description": "Lists all subscriptions under a given app.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions", // "httpMethod": "GET", - // "id": "androidpublisher.generatedapks.list", + // "id": "androidpublisher.monetization.subscriptions.list", // "parameterOrder": [ - // "packageName", - // "versionCode" + // "packageName" // ], // "parameters": { // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) for which the subscriptions should be read.", // "location": "path", // "required": true, // "type": "string" // }, - // "versionCode": { - // "description": "Version code of the app bundle.", + // "pageSize": { + // "description": "The maximum number of subscriptions to return. The service may return fewer than this value. If unspecified, at most 50 subscriptions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", - // "location": "path", - // "required": true, + // "location": "query", // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListSubscriptions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptions` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "showArchived": { + // "description": "Whether archived subscriptions should be included in the response. Defaults to false.", + // "location": "query", + // "type": "boolean" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions", // "response": { - // "$ref": "GeneratedApksListResponse" + // "$ref": "ListSubscriptionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11240,32 +15655,74 @@ func (c *GeneratedapksListCall) Do(opts ...googleapi.CallOption) (*GeneratedApks } -// method id "androidpublisher.grants.create": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *MonetizationSubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type GrantsCreateCall struct { - s *Service - parent string - grant *Grant - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "androidpublisher.monetization.subscriptions.patch": + +type MonetizationSubscriptionsPatchCall struct { + s *Service + packageName string + productId string + subscription *Subscription + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Grant access for a user to the given package. +// Patch: Updates an existing subscription. // -// - parent: The user which needs permission. Format: -// developers/{developer}/users/{user}. -func (r *GrantsService) Create(parent string, grant *Grant) *GrantsCreateCall { - c := &GrantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.grant = grant +// - packageName: Immutable. Package name of the parent app. +// - productId: Immutable. Unique product ID of the product. Unique +// within the parent app. Product IDs must be composed of lower-case +// letters (a-z), numbers (0-9), underscores (_) and dots (.). It must +// start with a lower-case letter or number, and be between 1 and 40 +// (inclusive) characters in length. +func (r *MonetizationSubscriptionsService) Patch(packageName string, productId string, subscription *Subscription) *MonetizationSubscriptionsPatchCall { + c := &MonetizationSubscriptionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.productId = productId + c.subscription = subscription + return c +} + +// RegionsVersionVersion sets the optional parameter +// "regionsVersion.version": Required. A string representing version of +// the available regions being used for the specified resource. +func (c *MonetizationSubscriptionsPatchCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsPatchCall { + c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The +// list of fields to be updated. +func (c *MonetizationSubscriptionsPatchCall) UpdateMask(updateMask string) *MonetizationSubscriptionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { +func (c *MonetizationSubscriptionsPatchCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11273,21 +15730,21 @@ func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GrantsCreateCall) Context(ctx context.Context) *GrantsCreateCall { +func (c *MonetizationSubscriptionsPatchCall) Context(ctx context.Context) *MonetizationSubscriptionsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GrantsCreateCall) Header() http.Header { +func (c *MonetizationSubscriptionsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11295,34 +15752,35 @@ func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/grants") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "packageName": c.packageName, + "productId": c.productId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.grants.create" call. -// Exactly one of *Grant or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Grant.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { +// Do executes the "androidpublisher.monetization.subscriptions.patch" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11341,7 +15799,7 @@ func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Grant{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11353,28 +15811,45 @@ func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } return ret, nil // { - // "description": "Grant access for a user to the given package.", - // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants", - // "httpMethod": "POST", - // "id": "androidpublisher.grants.create", + // "description": "Updates an existing subscription.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.monetization.subscriptions.patch", // "parameterOrder": [ - // "parent" + // "packageName", + // "productId" // ], // "parameters": { - // "parent": { - // "description": "Required. The user which needs permission. Format: developers/{developer}/users/{user}", + // "packageName": { + // "description": "Immutable. Package name of the parent app.", // "location": "path", - // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" + // }, + // "productId": { + // "description": "Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "regionsVersion.version": { + // "description": "Required. A string representing version of the available regions being used for the specified resource.", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. The list of fields to be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+parent}/grants", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}", // "request": { - // "$ref": "Grant" + // "$ref": "Subscription" // }, // "response": { - // "$ref": "Grant" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11383,31 +15858,40 @@ func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } -// method id "androidpublisher.grants.delete": +// method id "androidpublisher.monetization.subscriptions.basePlans.activate": -type GrantsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansActivateCall struct { + s *Service + packageName string + productId string + basePlanId string + activatebaseplanrequest *ActivateBasePlanRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Removes all access for the user to the given package or -// developer account. +// Activate: Activates a base plan. Once activated, base plans will be +// available to new subscribers. // -// - name: The name of the grant to delete. Format: -// developers/{developer}/users/{email}/grants/{package_name}. -func (r *GrantsService) Delete(name string) *GrantsDeleteCall { - c := &GrantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - basePlanId: The unique base plan ID of the base plan to activate. +// - packageName: The parent app (package name) of the base plan to +// activate. +// - productId: The parent subscription (ID) of the base plan to +// activate. +func (r *MonetizationSubscriptionsBasePlansService) Activate(packageName string, productId string, basePlanId string, activatebaseplanrequest *ActivateBasePlanRequest) *MonetizationSubscriptionsBasePlansActivateCall { + c := &MonetizationSubscriptionsBasePlansActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.productId = productId + c.basePlanId = basePlanId + c.activatebaseplanrequest = activatebaseplanrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansActivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11415,21 +15899,21 @@ func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GrantsDeleteCall) Context(ctx context.Context) *GrantsDeleteCall { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansActivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GrantsDeleteCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansActivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11437,51 +15921,102 @@ func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatebaseplanrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.grants.delete" call. -func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.activate" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansActivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return err + return nil, err } - return nil + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil // { - // "description": "Removes all access for the user to the given package or developer account.", - // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", - // "httpMethod": "DELETE", - // "id": "androidpublisher.grants.delete", + // "description": "Activates a base plan. Once activated, base plans will be available to new subscribers.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.activate", // "parameterOrder": [ - // "name" + // "packageName", + // "productId", + // "basePlanId" // ], // "parameters": { - // "name": { - // "description": "Required. The name of the grant to delete. Format: developers/{developer}/users/{email}/grants/{package_name}", + // "basePlanId": { + // "description": "Required. The unique base plan ID of the base plan to activate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Required. The parent app (package name) of the base plan to activate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The parent subscription (ID) of the base plan to activate.", // "location": "path", - // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+name}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate", + // "request": { + // "$ref": "ActivateBasePlanRequest" + // }, + // "response": { + // "$ref": "Subscription" + // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -11489,41 +16024,41 @@ func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.grants.patch": +// method id "androidpublisher.monetization.subscriptions.basePlans.deactivate": -type GrantsPatchCall struct { - s *Service - name string - grant *Grant - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansDeactivateCall struct { + s *Service + packageName string + productId string + basePlanId string + deactivatebaseplanrequest *DeactivateBasePlanRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates access for the user to the given package. +// Deactivate: Deactivates a base plan. Once deactivated, the base plan +// will become unavailable to new subscribers, but existing subscribers +// will maintain their subscription // -// - name: Resource name for this grant, following the pattern -// "developers/{developer}/users/{email}/grants/{package_name}". If -// this grant is for a draft app, the app ID will be used in this -// resource name instead of the package name. -func (r *GrantsService) Patch(name string, grant *Grant) *GrantsPatchCall { - c := &GrantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.grant = grant - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. -func (c *GrantsPatchCall) UpdateMask(updateMask string) *GrantsPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// - basePlanId: The unique base plan ID of the base plan to deactivate. +// - packageName: The parent app (package name) of the base plan to +// deactivate. +// - productId: The parent subscription (ID) of the base plan to +// deactivate. +func (r *MonetizationSubscriptionsBasePlansService) Deactivate(packageName string, productId string, basePlanId string, deactivatebaseplanrequest *DeactivateBasePlanRequest) *MonetizationSubscriptionsBasePlansDeactivateCall { + c := &MonetizationSubscriptionsBasePlansDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.productId = productId + c.basePlanId = basePlanId + c.deactivatebaseplanrequest = deactivatebaseplanrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansDeactivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11531,21 +16066,21 @@ func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *GrantsPatchCall) Context(ctx context.Context) *GrantsPatchCall { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansDeactivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *GrantsPatchCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11553,34 +16088,36 @@ func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatebaseplanrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.grants.patch" call. -// Exactly one of *Grant or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Grant.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.deactivate" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansDeactivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11599,7 +16136,7 @@ func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Grant{ + ret := &Subscription{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11611,34 +16148,41 @@ func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } return ret, nil // { - // "description": "Updates access for the user to the given package.", - // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.grants.patch", + // "description": "Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.deactivate", // "parameterOrder": [ - // "name" + // "packageName", + // "productId", + // "basePlanId" // ], // "parameters": { - // "name": { - // "description": "Required. Resource name for this grant, following the pattern \"developers/{developer}/users/{email}/grants/{package_name}\". If this grant is for a draft app, the app ID will be used in this resource name instead of the package name.", + // "basePlanId": { + // "description": "Required. The unique base plan ID of the base plan to deactivate.", // "location": "path", - // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // }, - // "updateMask": { - // "description": "Optional. The list of fields to be updated.", - // "format": "google-fieldmask", - // "location": "query", + // "packageName": { + // "description": "Required. The parent app (package name) of the base plan to deactivate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The parent subscription (ID) of the base plan to deactivate.", + // "location": "path", + // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/{+name}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate", // "request": { - // "$ref": "Grant" + // "$ref": "DeactivateBasePlanRequest" // }, // "response": { - // "$ref": "Grant" + // "$ref": "Subscription" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11647,33 +16191,37 @@ func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { } -// method id "androidpublisher.inappproducts.delete": +// method id "androidpublisher.monetization.subscriptions.basePlans.delete": -type InappproductsDeleteCall struct { +type MonetizationSubscriptionsBasePlansDeleteCall struct { s *Service packageName string - skuid string + productId string + basePlanId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes an in-app product (i.e. a managed product or a -// subscriptions). +// Delete: Deletes a base plan. Can only be done for draft base plans. +// This action is irreversible. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Delete(packageName string, skuid string) *InappproductsDeleteCall { - c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The unique offer ID of the base plan to delete. +// - packageName: The parent app (package name) of the base plan to +// delete. +// - productId: The parent subscription (ID) of the base plan to delete. +func (r *MonetizationSubscriptionsBasePlansService) Delete(packageName string, productId string, basePlanId string) *MonetizationSubscriptionsBasePlansDeleteCall { + c := &MonetizationSubscriptionsBasePlansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.skuid = skuid + c.productId = productId + c.basePlanId = basePlanId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11681,21 +16229,21 @@ func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsDeleteCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11705,7 +16253,7 @@ func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -11714,13 +16262,14 @@ func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.delete" call. -func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.delete" call. +func (c *MonetizationSubscriptionsBasePlansDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { @@ -11732,29 +16281,36 @@ func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { } return nil // { - // "description": "Deletes an in-app product (i.e. a managed product or a subscriptions).", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "description": "Deletes a base plan. Can only be done for draft base plans. This action is irreversible.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", // "httpMethod": "DELETE", - // "id": "androidpublisher.inappproducts.delete", + // "id": "androidpublisher.monetization.subscriptions.basePlans.delete", // "parameterOrder": [ // "packageName", - // "sku" + // "productId", + // "basePlanId" // ], // "parameters": { + // "basePlanId": { + // "description": "Required. The unique offer ID of the base plan to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the base plan to delete.", // "location": "path", // "required": true, // "type": "string" // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", + // "productId": { + // "description": "Required. The parent subscription (ID) of the base plan to delete.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -11762,100 +16318,104 @@ func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { } -// method id "androidpublisher.inappproducts.get": +// method id "androidpublisher.monetization.subscriptions.basePlans.migratePrices": -type InappproductsGetCall struct { - s *Service - packageName string - skuid string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansMigratePricesCall struct { + s *Service + packageName string + productId string + basePlanId string + migratebaseplanpricesrequest *MigrateBasePlanPricesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } - -// Get: Gets an in-app product, which can be a managed product or a -// subscription. + +// MigratePrices: Migrates subscribers who are receiving an historical +// subscription price to the currently-offered price for the specified +// region. Requests will cause price change notifications to be sent to +// users who are currently receiving an historical price older than the +// supplied timestamp. Subscribers who do not agree to the new price +// will have their subscription ended at the next renewal. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall { - c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The unique base plan ID of the base plan to update +// prices on. +// - packageName: Package name of the parent app. Must be equal to the +// package_name field on the Subscription resource. +// - productId: The ID of the subscription to update. Must be equal to +// the product_id field on the Subscription resource. +func (r *MonetizationSubscriptionsBasePlansService) MigratePrices(packageName string, productId string, basePlanId string, migratebaseplanpricesrequest *MigrateBasePlanPricesRequest) *MonetizationSubscriptionsBasePlansMigratePricesCall { + c := &MonetizationSubscriptionsBasePlansMigratePricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.skuid = skuid + c.productId = productId + c.basePlanId = basePlanId + c.migratebaseplanpricesrequest = migratebaseplanpricesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansMigratePricesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansMigratePricesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsGetCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.migratebaseplanpricesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.get" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.migratePrices" call. +// Exactly one of *MigrateBasePlanPricesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *MigrateBasePlanPricesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansMigratePricesCall) Do(opts ...googleapi.CallOption) (*MigrateBasePlanPricesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -11874,7 +16434,7 @@ func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &InAppProduct{ + ret := &MigrateBasePlanPricesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -11886,31 +16446,41 @@ func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, } return ret, nil // { - // "description": "Gets an in-app product, which can be a managed product or a subscription.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "GET", - // "id": "androidpublisher.inappproducts.get", + // "description": "Migrates subscribers who are receiving an historical subscription price to the currently-offered price for the specified region. Requests will cause price change notifications to be sent to users who are currently receiving an historical price older than the supplied timestamp. Subscribers who do not agree to the new price will have their subscription ended at the next renewal.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.migratePrices", // "parameterOrder": [ // "packageName", - // "sku" + // "productId", + // "basePlanId" // ], // "parameters": { + // "basePlanId": { + // "description": "Required. The unique base plan ID of the base plan to update prices on.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", + // "productId": { + // "description": "Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices", + // "request": { + // "$ref": "MigrateBasePlanPricesRequest" + // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "MigrateBasePlanPricesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -11919,42 +16489,42 @@ func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, } -// method id "androidpublisher.inappproducts.insert": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.activate": -type InappproductsInsertCall struct { - s *Service - packageName string - inappproduct *InAppProduct - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersActivateCall struct { + s *Service + packageName string + productId string + basePlanId string + offerId string + activatesubscriptionofferrequest *ActivateSubscriptionOfferRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates an in-app product (i.e. a managed product or a -// subscriptions). +// Activate: Activates a subscription offer. Once activated, +// subscription offers will be available to new subscribers. // -// - packageName: Package name of the app. -func (r *InappproductsService) Insert(packageName string, inappproduct *InAppProduct) *InappproductsInsertCall { - c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) of the offer to activate. +// - offerId: The unique offer ID of the offer to activate. +// - packageName: The parent app (package name) of the offer to +// activate. +// - productId: The parent subscription (ID) of the offer to activate. +func (r *MonetizationSubscriptionsBasePlansOffersService) Activate(packageName string, productId string, basePlanId string, offerId string, activatesubscriptionofferrequest *ActivateSubscriptionOfferRequest) *MonetizationSubscriptionsBasePlansOffersActivateCall { + c := &MonetizationSubscriptionsBasePlansOffersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.inappproduct = inappproduct - return c -} - -// AutoConvertMissingPrices sets the optional parameter -// "autoConvertMissingPrices": If true the prices for all regions -// targeted by the parent app that don't have a price specified for this -// in-app product will be auto converted to the target currency based on -// the default price. Defaults to false. -func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall { - c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) + c.productId = productId + c.basePlanId = basePlanId + c.offerId = offerId + c.activatesubscriptionofferrequest = activatesubscriptionofferrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersActivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -11962,21 +16532,21 @@ func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsIns // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersActivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsInsertCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -11984,14 +16554,14 @@ func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.activatesubscriptionofferrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -12000,18 +16570,21 @@ func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, + "offerId": c.offerId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.insert" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.activate" call. +// Exactly one of *SubscriptionOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansOffersActivateCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12030,7 +16603,7 @@ func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduc if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &InAppProduct{ + ret := &SubscriptionOffer{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12042,32 +16615,48 @@ func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduc } return ret, nil // { - // "description": "Creates an in-app product (i.e. a managed product or a subscriptions).", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "description": "Activates a subscription offer. Once activated, subscription offers will be available to new subscribers.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", // "httpMethod": "POST", - // "id": "androidpublisher.inappproducts.insert", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.activate", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId", + // "offerId" // ], // "parameters": { - // "autoConvertMissingPrices": { - // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", - // "location": "query", - // "type": "boolean" + // "basePlanId": { + // "description": "Required. The parent base plan (ID) of the offer to activate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "offerId": { + // "description": "Required. The unique offer ID of the offer to activate.", + // "location": "path", + // "required": true, + // "type": "string" // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the offer to activate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The parent subscription (ID) of the offer to activate.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate", // "request": { - // "$ref": "InAppProduct" + // "$ref": "ActivateSubscriptionOfferRequest" // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "SubscriptionOffer" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -12076,121 +16665,121 @@ func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduc } -// method id "androidpublisher.inappproducts.list": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.create": -type InappproductsListCall struct { - s *Service - packageName string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersCreateCall struct { + s *Service + packageName string + productId string + basePlanId string + subscriptionoffer *SubscriptionOffer + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all in-app products - both managed products and -// subscriptions. If an app has a large number of in-app products, the -// response may be paginated. In this case the response field -// `tokenPagination.nextPageToken` will be set and the caller should -// provide its value as a `token` request parameter to retrieve the next -// page. +// Create: Creates a new subscription offer. Only auto-renewing base +// plans can have subscription offers. The offer state will be DRAFT +// until it is activated. // -// - packageName: Package name of the app. -func (r *InappproductsService) List(packageName string) *InappproductsListCall { - c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) for which the offer should be +// created. Must be equal to the base_plan_id field on the +// SubscriptionOffer resource. +// - packageName: The parent app (package name) for which the offer +// should be created. Must be equal to the package_name field on the +// Subscription resource. +// - productId: The parent subscription (ID) for which the offer should +// be created. Must be equal to the product_id field on the +// SubscriptionOffer resource. +func (r *MonetizationSubscriptionsBasePlansOffersService) Create(packageName string, productId string, basePlanId string, subscriptionoffer *SubscriptionOffer) *MonetizationSubscriptionsBasePlansOffersCreateCall { + c := &MonetizationSubscriptionsBasePlansOffersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName + c.productId = productId + c.basePlanId = basePlanId + c.subscriptionoffer = subscriptionoffer return c } -// MaxResults sets the optional parameter "maxResults": Deprecated and -// ignored. The page size is determined by the server. -func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// StartIndex sets the optional parameter "startIndex": Deprecated and -// ignored. Set the `token` parameter to rertieve the next page. -func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall { - c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) +// OfferId sets the optional parameter "offerId": Required. The ID to +// use for the offer. For the requirements on this format, see the +// documentation of the offer_id field on the SubscriptionOffer +// resource. +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) OfferId(offerId string) *MonetizationSubscriptionsBasePlansOffersCreateCall { + c.urlParams_.Set("offerId", offerId) return c } -// Token sets the optional parameter "token": Pagination token. If -// empty, list starts at the first product. -func (c *InappproductsListCall) Token(token string) *InappproductsListCall { - c.urlParams_.Set("token", token) +// RegionsVersionVersion sets the optional parameter +// "regionsVersion.version": Required. A string representing version of +// the available regions being used for the specified resource. +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsBasePlansOffersCreateCall { + c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall { +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall { +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsListCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionoffer) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.list" call. -// Exactly one of *InappproductsListResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *InappproductsListResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.create" call. +// Exactly one of *SubscriptionOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) { +func (c *MonetizationSubscriptionsBasePlansOffersCreateCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12209,7 +16798,7 @@ func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*Inappproducts if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &InappproductsListResponse{ + ret := &SubscriptionOffer{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12221,88 +16810,96 @@ func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*Inappproducts } return ret, nil // { - // "description": "Lists all in-app products - both managed products and subscriptions. If an app has a large number of in-app products, the response may be paginated. In this case the response field `tokenPagination.nextPageToken` will be set and the caller should provide its value as a `token` request parameter to retrieve the next page.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", - // "httpMethod": "GET", - // "id": "androidpublisher.inappproducts.list", + // "description": "Creates a new subscription offer. Only auto-renewing base plans can have subscription offers. The offer state will be DRAFT until it is activated.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.create", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId" // ], // "parameters": { - // "maxResults": { - // "description": "Deprecated and ignored. The page size is determined by the server.", - // "format": "uint32", + // "basePlanId": { + // "description": "Required. The parent base plan (ID) for which the offer should be created. Must be equal to the base_plan_id field on the SubscriptionOffer resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "offerId": { + // "description": "Required. The ID to use for the offer. For the requirements on this format, see the documentation of the offer_id field on the SubscriptionOffer resource.", // "location": "query", - // "type": "integer" + // "type": "string" // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) for which the offer should be created. Must be equal to the package_name field on the Subscription resource.", // "location": "path", // "required": true, // "type": "string" // }, - // "startIndex": { - // "description": "Deprecated and ignored. Set the `token` parameter to rertieve the next page.", - // "format": "uint32", - // "location": "query", - // "type": "integer" + // "productId": { + // "description": "Required. The parent subscription (ID) for which the offer should be created. Must be equal to the product_id field on the SubscriptionOffer resource.", + // "location": "path", + // "required": true, + // "type": "string" // }, - // "token": { - // "description": "Pagination token. If empty, list starts at the first product.", + // "regionsVersion.version": { + // "description": "Required. A string representing version of the available regions being used for the specified resource.", // "location": "query", // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + // "request": { + // "$ref": "SubscriptionOffer" + // }, // "response": { - // "$ref": "InappproductsListResponse" + // "$ref": "SubscriptionOffer" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ] - // } - -} - -// method id "androidpublisher.inappproducts.patch": - -type InappproductsPatchCall struct { - s *Service - packageName string - skuid string - inappproduct *InAppProduct - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + // ] + // } + } -// Patch: Patches an in-app product (i.e. a managed product or a -// subscriptions). -// -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Patch(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall { - c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - c.skuid = skuid - c.inappproduct = inappproduct - return c +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.deactivate": + +type MonetizationSubscriptionsBasePlansOffersDeactivateCall struct { + s *Service + packageName string + productId string + basePlanId string + offerId string + deactivatesubscriptionofferrequest *DeactivateSubscriptionOfferRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AutoConvertMissingPrices sets the optional parameter -// "autoConvertMissingPrices": If true the prices for all regions -// targeted by the parent app that don't have a price specified for this -// in-app product will be auto converted to the target currency based on -// the default price. Defaults to false. -func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall { - c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) +// Deactivate: Deactivates a subscription offer. Once deactivated, +// existing subscribers will maintain their subscription, but the offer +// will become unavailable to new subscribers. +// +// - basePlanId: The parent base plan (ID) of the offer to deactivate. +// - offerId: The unique offer ID of the offer to deactivate. +// - packageName: The parent app (package name) of the offer to +// deactivate. +// - productId: The parent subscription (ID) of the offer to deactivate. +func (r *MonetizationSubscriptionsBasePlansOffersService) Deactivate(packageName string, productId string, basePlanId string, offerId string, deactivatesubscriptionofferrequest *DeactivateSubscriptionOfferRequest) *MonetizationSubscriptionsBasePlansOffersDeactivateCall { + c := &MonetizationSubscriptionsBasePlansOffersDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.productId = productId + c.basePlanId = basePlanId + c.offerId = offerId + c.deactivatesubscriptionofferrequest = deactivatesubscriptionofferrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall { +func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersDeactivateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12310,21 +16907,21 @@ func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall { +func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersDeactivateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsPatchCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12332,35 +16929,37 @@ func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivatesubscriptionofferrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, + "productId": c.productId, + "basePlanId": c.basePlanId, + "offerId": c.offerId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.patch" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.deactivate" call. +// Exactly one of *SubscriptionOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MonetizationSubscriptionsBasePlansOffersDeactivateCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12379,7 +16978,7 @@ func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &InAppProduct{ + ret := &SubscriptionOffer{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12391,39 +16990,48 @@ func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct } return ret, nil // { - // "description": "Patches an in-app product (i.e. a managed product or a subscriptions).", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "PATCH", - // "id": "androidpublisher.inappproducts.patch", + // "description": "Deactivates a subscription offer. Once deactivated, existing subscribers will maintain their subscription, but the offer will become unavailable to new subscribers.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate", + // "httpMethod": "POST", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.deactivate", // "parameterOrder": [ // "packageName", - // "sku" + // "productId", + // "basePlanId", + // "offerId" // ], // "parameters": { - // "autoConvertMissingPrices": { - // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", - // "location": "query", - // "type": "boolean" + // "basePlanId": { + // "description": "Required. The parent base plan (ID) of the offer to deactivate.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "offerId": { + // "description": "Required. The unique offer ID of the offer to deactivate.", + // "location": "path", + // "required": true, + // "type": "string" // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the offer to deactivate.", // "location": "path", // "required": true, // "type": "string" // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", + // "productId": { + // "description": "Required. The parent subscription (ID) of the offer to deactivate.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate", // "request": { - // "$ref": "InAppProduct" + // "$ref": "DeactivateSubscriptionOfferRequest" // }, // "response": { - // "$ref": "InAppProduct" + // "$ref": "SubscriptionOffer" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -12432,53 +17040,39 @@ func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct } -// method id "androidpublisher.inappproducts.update": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.delete": -type InappproductsUpdateCall struct { - s *Service - packageName string - skuid string - inappproduct *InAppProduct - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersDeleteCall struct { + s *Service + packageName string + productId string + basePlanId string + offerId string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Updates an in-app product (i.e. a managed product or a -// subscriptions). +// Delete: Deletes a subscription offer. Can only be done for draft +// offers. This action is irreversible. // -// - packageName: Package name of the app. -// - sku: Unique identifier for the in-app product. -func (r *InappproductsService) Update(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall { - c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) of the offer to delete. +// - offerId: The unique offer ID of the offer to delete. +// - packageName: The parent app (package name) of the offer to delete. +// - productId: The parent subscription (ID) of the offer to delete. +func (r *MonetizationSubscriptionsBasePlansOffersService) Delete(packageName string, productId string, basePlanId string, offerId string) *MonetizationSubscriptionsBasePlansOffersDeleteCall { + c := &MonetizationSubscriptionsBasePlansOffersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.skuid = skuid - c.inappproduct = inappproduct - return c -} - -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the in-app product with the given package_name and sku -// doesn't exist, the in-app product will be created. -func (c *InappproductsUpdateCall) AllowMissing(allowMissing bool) *InappproductsUpdateCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) - return c -} - -// AutoConvertMissingPrices sets the optional parameter -// "autoConvertMissingPrices": If true the prices for all regions -// targeted by the parent app that don't have a price specified for this -// in-app product will be auto converted to the target currency based on -// the default price. Defaults to false. -func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall { - c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) + c.productId = productId + c.basePlanId = basePlanId + c.offerId = offerId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall { +func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -12486,21 +17080,21 @@ func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpd // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall { +func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InappproductsUpdateCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -12508,104 +17102,74 @@ func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, - "sku": c.skuid, + "productId": c.productId, + "basePlanId": c.basePlanId, + "offerId": c.offerId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.inappproducts.update" call. -// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *InAppProduct.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.delete" call. +func (c *MonetizationSubscriptionsBasePlansOffersDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &InAppProduct{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return err } - return ret, nil + return nil // { - // "description": "Updates an in-app product (i.e. a managed product or a subscriptions).", - // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "httpMethod": "PUT", - // "id": "androidpublisher.inappproducts.update", + // "description": "Deletes a subscription offer. Can only be done for draft offers. This action is irreversible.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + // "httpMethod": "DELETE", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.delete", // "parameterOrder": [ // "packageName", - // "sku" + // "productId", + // "basePlanId", + // "offerId" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the in-app product with the given package_name and sku doesn't exist, the in-app product will be created.", - // "location": "query", - // "type": "boolean" + // "basePlanId": { + // "description": "Required. The parent base plan (ID) of the offer to delete.", + // "location": "path", + // "required": true, + // "type": "string" // }, - // "autoConvertMissingPrices": { - // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", - // "location": "query", - // "type": "boolean" + // "offerId": { + // "description": "Required. The unique offer ID of the offer to delete.", + // "location": "path", + // "required": true, + // "type": "string" // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the offer to delete.", // "location": "path", // "required": true, // "type": "string" // }, - // "sku": { - // "description": "Unique identifier for the in-app product.", + // "productId": { + // "description": "Required. The parent subscription (ID) of the offer to delete.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", - // "request": { - // "$ref": "InAppProduct" - // }, - // "response": { - // "$ref": "InAppProduct" - // }, + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] @@ -12613,137 +17177,107 @@ func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduc } -// method id "androidpublisher.internalappsharingartifacts.uploadapk": - -type InternalappsharingartifactsUploadapkCall struct { - s *Service - packageName string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header -} - -// Uploadapk: Uploads an APK to internal app sharing. If you are using -// the Google API client libraries, please increase the timeout of the -// http request before calling this endpoint (a timeout of 2 minutes is -// recommended). See Timeouts and Errors -// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) -// for an example in java. -// -// - packageName: Package name of the app. -func (r *InternalappsharingartifactsService) Uploadapk(packageName string) *InternalappsharingartifactsUploadapkCall { - c := &InternalappsharingartifactsUploadapkCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.packageName = packageName - return c -} - -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *InternalappsharingartifactsUploadapkCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadapkCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.get": -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *InternalappsharingartifactsUploadapkCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadapkCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) - return c +type MonetizationSubscriptionsBasePlansOffersGetCall struct { + s *Service + packageName string + productId string + basePlanId string + offerId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *InternalappsharingartifactsUploadapkCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadapkCall { - c.mediaInfo_.SetProgressUpdater(pu) +// Get: Reads a single offer +// +// - basePlanId: The parent base plan (ID) of the offer to get. +// - offerId: The unique offer ID of the offer to get. +// - packageName: The parent app (package name) of the offer to get. +// - productId: The parent subscription (ID) of the offer to get. +func (r *MonetizationSubscriptionsBasePlansOffersService) Get(packageName string, productId string, basePlanId string, offerId string) *MonetizationSubscriptionsBasePlansOffersGetCall { + c := &MonetizationSubscriptionsBasePlansOffersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.productId = productId + c.basePlanId = basePlanId + c.offerId = offerId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InternalappsharingartifactsUploadapkCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadapkCall { +func (c *MonetizationSubscriptionsBasePlansOffersGetCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MonetizationSubscriptionsBasePlansOffersGetCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsBasePlansOffersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *InternalappsharingartifactsUploadapkCall) Context(ctx context.Context) *InternalappsharingartifactsUploadapkCall { +func (c *MonetizationSubscriptionsBasePlansOffersGetCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InternalappsharingartifactsUploadapkCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, + "offerId": c.offerId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.internalappsharingartifacts.uploadapk" call. -// Exactly one of *InternalAppSharingArtifact or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *InternalAppSharingArtifact.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.get" call. +// Exactly one of *SubscriptionOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { +func (c *MonetizationSubscriptionsBasePlansOffersGetCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12762,24 +17296,7 @@ func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, err } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &InternalAppSharingArtifact{ + ret := &SubscriptionOffer{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -12791,181 +17308,173 @@ func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOpti } return ret, nil // { - // "description": "Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", - // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", - // "httpMethod": "POST", - // "id": "androidpublisher.internalappsharingartifacts.uploadapk", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream", - // "application/vnd.android.package-archive" - // ], - // "maxSize": "1073741824", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" - // } - // } - // }, + // "description": "Reads a single offer", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + // "httpMethod": "GET", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.get", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId", + // "offerId" // ], // "parameters": { + // "basePlanId": { + // "description": "Required. The parent base plan (ID) of the offer to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "offerId": { + // "description": "Required. The unique offer ID of the offer to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) of the offer to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. The parent subscription (ID) of the offer to get.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", // "response": { - // "$ref": "InternalAppSharingArtifact" + // "$ref": "SubscriptionOffer" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.internalappsharingartifacts.uploadbundle": +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.list": -type InternalappsharingartifactsUploadbundleCall struct { - s *Service - packageName string - urlParams_ gensupport.URLParams - mediaInfo_ *gensupport.MediaInfo - ctx_ context.Context - header_ http.Header +type MonetizationSubscriptionsBasePlansOffersListCall struct { + s *Service + packageName string + productId string + basePlanId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Uploadbundle: Uploads an app bundle to internal app sharing. If you -// are using the Google API client libraries, please increase the -// timeout of the http request before calling this endpoint (a timeout -// of 2 minutes is recommended). See Timeouts and Errors -// (https://developers.google.com/api-client-library/java/google-api-java-client/errors) -// for an example in java. +// List: Lists all offers under a given subscription. // -// - packageName: Package name of the app. -func (r *InternalappsharingartifactsService) Uploadbundle(packageName string) *InternalappsharingartifactsUploadbundleCall { - c := &InternalappsharingartifactsUploadbundleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: The parent base plan (ID) for which the offers should +// be read. May be specified as '-' to read all offers under a +// subscription. +// - packageName: The parent app (package name) for which the +// subscriptions should be read. +// - productId: The parent subscription (ID) for which the offers should +// be read. +func (r *MonetizationSubscriptionsBasePlansOffersService) List(packageName string, productId string, basePlanId string) *MonetizationSubscriptionsBasePlansOffersListCall { + c := &MonetizationSubscriptionsBasePlansOffersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName + c.productId = productId + c.basePlanId = basePlanId return c } -// Media specifies the media to upload in one or more chunks. The chunk -// size may be controlled by supplying a MediaOption generated by -// googleapi.ChunkSize. The chunk size defaults to -// googleapi.DefaultUploadChunkSize.The Content-Type header used in the -// upload request will be determined by sniffing the contents of r, -// unless a MediaOption generated by googleapi.ContentType is -// supplied. -// At most one of Media and ResumableMedia may be set. -func (c *InternalappsharingartifactsUploadbundleCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadbundleCall { - c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) - return c -} - -// ResumableMedia specifies the media to upload in chunks and can be -// canceled with ctx. -// -// Deprecated: use Media instead. -// -// At most one of Media and ResumableMedia may be set. mediaType -// identifies the MIME media type of the upload, such as "image/png". If -// mediaType is "", it will be auto-detected. The provided ctx will -// supersede any context previously provided to the Context method. -func (c *InternalappsharingartifactsUploadbundleCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadbundleCall { - c.ctx_ = ctx - c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) +// PageSize sets the optional parameter "pageSize": The maximum number +// of subscriptions to return. The service may return fewer than this +// value. If unspecified, at most 50 subscriptions will be returned. The +// maximum value is 1000; values above 1000 will be coerced to 1000. +func (c *MonetizationSubscriptionsBasePlansOffersListCall) PageSize(pageSize int64) *MonetizationSubscriptionsBasePlansOffersListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// ProgressUpdater provides a callback function that will be called -// after every chunk. It should be a low-latency function in order to -// not slow down the upload operation. This should only be called when -// using ResumableMedia (as opposed to Media). -func (c *InternalappsharingartifactsUploadbundleCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadbundleCall { - c.mediaInfo_.SetProgressUpdater(pu) +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListSubscriptionsOffers` call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to `ListSubscriptionOffers` must match the call +// that provided the page token. +func (c *MonetizationSubscriptionsBasePlansOffersListCall) PageToken(pageToken string) *MonetizationSubscriptionsBasePlansOffersListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InternalappsharingartifactsUploadbundleCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadbundleCall { +func (c *MonetizationSubscriptionsBasePlansOffersListCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MonetizationSubscriptionsBasePlansOffersListCall) IfNoneMatch(entityTag string) *MonetizationSubscriptionsBasePlansOffersListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -// This context will supersede any context previously provided to the -// ResumableMedia method. -func (c *InternalappsharingartifactsUploadbundleCall) Context(ctx context.Context) *InternalappsharingartifactsUploadbundleCall { +func (c *MonetizationSubscriptionsBasePlansOffersListCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *InternalappsharingartifactsUploadbundleCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") - if c.mediaInfo_ != nil { - urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") - c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) - } - if body == nil { - body = new(bytes.Buffer) - reqHeaders.Set("Content-Type", "application/json") - } - body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) - defer cleanup() + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders - req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.internalappsharingartifacts.uploadbundle" call. -// Exactly one of *InternalAppSharingArtifact or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *InternalAppSharingArtifact.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.list" call. +// Exactly one of *ListSubscriptionOffersResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListSubscriptionOffersResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { +func (c *MonetizationSubscriptionsBasePlansOffersListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionOffersResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -12984,24 +17493,7 @@ func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, err } - rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) - if rx != nil { - rx.Client = c.s.client - rx.UserAgent = c.s.userAgent() - ctx := c.ctx_ - if ctx == nil { - ctx = context.TODO() - } - res, err = rx.Upload(ctx) - if err != nil { - return nil, err - } - defer res.Body.Close() - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - } - ret := &InternalAppSharingArtifact{ + ret := &ListSubscriptionOffersResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13013,76 +17505,131 @@ func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallO } return ret, nil // { - // "description": "Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", - // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", - // "httpMethod": "POST", - // "id": "androidpublisher.internalappsharingartifacts.uploadbundle", - // "mediaUpload": { - // "accept": [ - // "application/octet-stream" - // ], - // "maxSize": "10737418240", - // "protocols": { - // "resumable": { - // "multipart": true, - // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" - // }, - // "simple": { - // "multipart": true, - // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" - // } - // } - // }, + // "description": "Lists all offers under a given subscription.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", + // "httpMethod": "GET", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.list", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId" // ], // "parameters": { + // "basePlanId": { + // "description": "Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { - // "description": "Package name of the app.", + // "description": "Required. The parent app (package name) for which the subscriptions should be read.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of subscriptions to return. The service may return fewer than this value. If unspecified, at most 50 subscriptions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListSubscriptionsOffers` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptionOffers` must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "Required. The parent subscription (ID) for which the offers should be read.", // "location": "path", // "required": true, // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers", // "response": { - // "$ref": "InternalAppSharingArtifact" + // "$ref": "ListSubscriptionOffersResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" - // ], - // "supportsMediaUpload": true + // ] // } } -// method id "androidpublisher.monetization.convertRegionPrices": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *MonetizationSubscriptionsBasePlansOffersListCall) Pages(ctx context.Context, f func(*ListSubscriptionOffersResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type MonetizationConvertRegionPricesCall struct { - s *Service - packageName string - convertregionpricesrequest *ConvertRegionPricesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "androidpublisher.monetization.subscriptions.basePlans.offers.patch": + +type MonetizationSubscriptionsBasePlansOffersPatchCall struct { + s *Service + packageName string + productId string + basePlanId string + offerId string + subscriptionoffer *SubscriptionOffer + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ConvertRegionPrices: Calculates the region prices, using today's -// exchange rate and country-specific pricing patterns, based on the -// price in the request for a set of regions. +// Patch: Updates an existing subscription offer. // -// - packageName: The app package name. -func (r *MonetizationService) ConvertRegionPrices(packageName string, convertregionpricesrequest *ConvertRegionPricesRequest) *MonetizationConvertRegionPricesCall { - c := &MonetizationConvertRegionPricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - basePlanId: Immutable. The ID of the base plan to which this offer +// is an extension. +// - offerId: Immutable. Unique ID of this subscription offer. Must be +// unique within the base plan. +// - packageName: Immutable. The package name of the app the parent +// subscription belongs to. +// - productId: Immutable. The ID of the parent subscription this offer +// belongs to. +func (r *MonetizationSubscriptionsBasePlansOffersService) Patch(packageName string, productId string, basePlanId string, offerId string, subscriptionoffer *SubscriptionOffer) *MonetizationSubscriptionsBasePlansOffersPatchCall { + c := &MonetizationSubscriptionsBasePlansOffersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName - c.convertregionpricesrequest = convertregionpricesrequest + c.productId = productId + c.basePlanId = basePlanId + c.offerId = offerId + c.subscriptionoffer = subscriptionoffer + return c +} + +// RegionsVersionVersion sets the optional parameter +// "regionsVersion.version": Required. A string representing version of +// the available regions being used for the specified resource. +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) RegionsVersionVersion(regionsVersionVersion string) *MonetizationSubscriptionsBasePlansOffersPatchCall { + c.urlParams_.Set("regionsVersion.version", regionsVersionVersion) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The +// list of fields to be updated. +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) UpdateMask(updateMask string) *MonetizationSubscriptionsBasePlansOffersPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *MonetizationConvertRegionPricesCall) Fields(s ...googleapi.Field) *MonetizationConvertRegionPricesCall { +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) Fields(s ...googleapi.Field) *MonetizationSubscriptionsBasePlansOffersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -13090,21 +17637,21 @@ func (c *MonetizationConvertRegionPricesCall) Fields(s ...googleapi.Field) *Mone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *MonetizationConvertRegionPricesCall) Context(ctx context.Context) *MonetizationConvertRegionPricesCall { +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) Context(ctx context.Context) *MonetizationSubscriptionsBasePlansOffersPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *MonetizationConvertRegionPricesCall) Header() http.Header { +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Response, error) { +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -13112,34 +17659,37 @@ func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertregionpricesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionoffer) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, + "productId": c.productId, + "basePlanId": c.basePlanId, + "offerId": c.offerId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "androidpublisher.monetization.convertRegionPrices" call. -// Exactly one of *ConvertRegionPricesResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ConvertRegionPricesResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "androidpublisher.monetization.subscriptions.basePlans.offers.patch" call. +// Exactly one of *SubscriptionOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) (*ConvertRegionPricesResponse, error) { +func (c *MonetizationSubscriptionsBasePlansOffersPatchCall) Do(opts ...googleapi.CallOption) (*SubscriptionOffer, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -13158,7 +17708,7 @@ func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ConvertRegionPricesResponse{ + ret := &SubscriptionOffer{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -13170,27 +17720,59 @@ func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Calculates the region prices, using today's exchange rate and country-specific pricing patterns, based on the price in the request for a set of regions.", - // "flatPath": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", - // "httpMethod": "POST", - // "id": "androidpublisher.monetization.convertRegionPrices", + // "description": "Updates an existing subscription offer.", + // "flatPath": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", + // "httpMethod": "PATCH", + // "id": "androidpublisher.monetization.subscriptions.basePlans.offers.patch", // "parameterOrder": [ - // "packageName" + // "packageName", + // "productId", + // "basePlanId", + // "offerId" // ], // "parameters": { + // "basePlanId": { + // "description": "Required. Immutable. The ID of the base plan to which this offer is an extension.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "offerId": { + // "description": "Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan.", + // "location": "path", + // "required": true, + // "type": "string" + // }, // "packageName": { - // "description": "Required. The app package name.", + // "description": "Required. Immutable. The package name of the app the parent subscription belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "Required. Immutable. The ID of the parent subscription this offer belongs to.", // "location": "path", // "required": true, // "type": "string" + // }, + // "regionsVersion.version": { + // "description": "Required. A string representing version of the available regions being used for the specified resource.", + // "location": "query", + // "type": "string" + // }, + // "updateMask": { + // "description": "Required. The list of fields to be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, - // "path": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", + // "path": "androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}", // "request": { - // "$ref": "ConvertRegionPricesRequest" + // "$ref": "SubscriptionOffer" // }, // "response": { - // "$ref": "ConvertRegionPricesResponse" + // "$ref": "SubscriptionOffer" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" @@ -14506,6 +19088,164 @@ func (c *PurchasesSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) erro } +// method id "androidpublisher.purchases.subscriptionsv2.get": + +type PurchasesSubscriptionsv2GetCall struct { + s *Service + packageName string + token string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Get metadata about a subscription +// +// - packageName: The package of the application for which this +// subscription was purchased (for example, 'com.some.thing'). +// - token: The token provided to the user's device when the +// subscription was purchased. +func (r *PurchasesSubscriptionsv2Service) Get(packageName string, token string) *PurchasesSubscriptionsv2GetCall { + c := &PurchasesSubscriptionsv2GetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.packageName = packageName + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesSubscriptionsv2GetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsv2GetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PurchasesSubscriptionsv2GetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsv2GetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *PurchasesSubscriptionsv2GetCall) Context(ctx context.Context) *PurchasesSubscriptionsv2GetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *PurchasesSubscriptionsv2GetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *PurchasesSubscriptionsv2GetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "token": c.token, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "androidpublisher.purchases.subscriptionsv2.get" call. +// Exactly one of *SubscriptionPurchaseV2 or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionPurchaseV2.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PurchasesSubscriptionsv2GetCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchaseV2, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubscriptionPurchaseV2{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get metadata about a subscription", + // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}", + // "httpMethod": "GET", + // "id": "androidpublisher.purchases.subscriptionsv2.get", + // "parameterOrder": [ + // "packageName", + // "token" + // ], + // "parameters": { + // "packageName": { + // "description": "The package of the application for which this subscription was purchased (for example, 'com.some.thing').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "token": { + // "description": "Required. The token provided to the user's device when the subscription was purchased.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}", + // "response": { + // "$ref": "SubscriptionPurchaseV2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + // method id "androidpublisher.purchases.voidedpurchases.list": type PurchasesVoidedpurchasesListCall struct { diff --git a/compute/v0.alpha/compute-api.json b/compute/v0.alpha/compute-api.json index bcbf46b3e69..43c92a1d4f4 100644 --- a/compute/v0.alpha/compute-api.json +++ b/compute/v0.alpha/compute-api.json @@ -21451,6 +21451,55 @@ "https://www.googleapis.com/auth/compute" ] }, + "setSecurityPolicy": { + "description": "Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview", + "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy", + "httpMethod": "POST", + "id": "compute.regionBackendServices.setSecurityPolicy", + "parameterOrder": [ + "project", + "region", + "backendService" + ], + "parameters": { + "backendService": { + "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy", + "request": { + "$ref": "SecurityPolicyReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "testIamPermissions": { "description": "Returns permissions that a caller has on the specified resource.", "flatPath": "projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions", @@ -38660,7 +38709,7 @@ } } }, - "revision": "20220426", + "revision": "20220506", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -44852,11 +44901,13 @@ "description": "The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).", "enum": [ "ANY", + "ANY_SINGLE_ZONE", "BALANCED", "EVEN" ], "enumDescriptions": [ "The group picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability.", + "The group creates all VM instances within a single zone. The zone is selected based on the present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads with heavy interprocess communication.", "The group prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across selected zones to minimize the impact of zonal failure. Recommended for highly available serving workloads.", "The group schedules VM instance creation and deletion to achieve and maintain an even number of managed instances across the selected zones. The distribution is even when the number of managed instances does not differ by more than 1 between any two zones. Recommended for highly available serving workloads." ], @@ -46101,7 +46152,7 @@ "id": "ForwardingRule", "properties": { "IPAddress": { - "description": "IP address that this forwarding rule serves. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the target that you specify in the forwarding rule. If you don't specify a reserved IP address, an ephemeral IP address is assigned. Methods for specifying an IP address: * IPv4 dotted decimal, as in `100.1.2.3` * Full URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The loadBalancingScheme and the forwarding rule's target determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). Must be set to `0.0.0.0` when the target is targetGrpcProxy that has validateForProxyless field set to true. For Private Service Connect forwarding rules that forward traffic to Google APIs, IP address must be provided.", + "description": "IP address for which this forwarding rule accepts traffic. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the referenced target or backendService. While creating a forwarding rule, specifying an IPAddress is required under the following circumstances: - When the target is set to targetGrpcProxy and validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0. - When the target is a Private Service Connect Google APIs bundle, you must specify an IPAddress. Otherwise, you can optionally specify an IP address that references an existing static (reserved) IP address resource. When omitted, Google Cloud assigns an ephemeral IP address. Use one of the following formats to specify an IP address while creating a forwarding rule: * IP address number, as in `100.1.2.3` * Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The forwarding rule's target or backendService, and in most cases, also the loadBalancingScheme, determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). When reading an IPAddress, the API always returns the IP address number.", "type": "string" }, "IPProtocol": { @@ -48691,7 +48742,7 @@ "type": "string" }, "hosts": { - "description": "The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.", + "description": "The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.", "items": { "type": "string" }, @@ -49153,7 +49204,7 @@ }, "faultInjectionPolicy": { "$ref": "HttpFaultInjection", - "description": "The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection." + "description": "The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the global external HTTP(S) load balancer (classic). To see which load balancers support fault injection, see Load balancing: Routing and traffic management features." }, "maxStreamDuration": { "$ref": "Duration", @@ -51351,7 +51402,7 @@ "type": "integer" }, "minimalAction": { - "description": "Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.", + "description": "Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action to REFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes. ", "enum": [ "NONE", "REFRESH", @@ -66308,7 +66359,7 @@ "id": "ResourcePolicyGroupPlacementPolicy", "properties": { "availabilityDomainCount": { - "description": "The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network", + "description": "The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network.", "format": "int32", "type": "integer" }, @@ -66367,7 +66418,7 @@ "type": "string" }, "vmCount": { - "description": "Number of vms in this placement group", + "description": "Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs.", "format": "int32", "type": "integer" } @@ -70807,6 +70858,11 @@ "description": "Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.", "type": "string" }, + "creationSizeBytes": { + "description": "[Output Only] Size in bytes of the snapshot at creation time.", + "format": "int64", + "type": "string" + }, "creationTimestamp": { "description": "[Output Only] Creation timestamp in RFC3339 text format.", "type": "string" diff --git a/compute/v0.alpha/compute-gen.go b/compute/v0.alpha/compute-gen.go index 015bf82acf0..09dc52155a4 100644 --- a/compute/v0.alpha/compute-gen.go +++ b/compute/v0.alpha/compute-gen.go @@ -11158,6 +11158,11 @@ type DistributionPolicy struct { // the requested number of VMs within present resource constraints and // to maximize utilization of unused zonal reservations. Recommended for // batch workloads that do not require high availability. + // "ANY_SINGLE_ZONE" - The group creates all VM instances within a + // single zone. The zone is selected based on the present resource + // constraints and to maximize utilization of unused zonal reservations. + // Recommended for batch workloads with heavy interprocess + // communication. // "BALANCED" - The group prioritizes acquisition of resources, // scheduling VMs in zones where resources are available while // distributing VMs as evenly as possible across selected zones to @@ -13131,24 +13136,31 @@ func (s *FixedOrPercent) MarshalJSON() ([]byte, error) { // Classic gateways (targetVpnGateway). For more information, read // Forwarding rule concepts and Using protocol forwarding. type ForwardingRule struct { - // IPAddress: IP address that this forwarding rule serves. When a client - // sends traffic to this IP address, the forwarding rule directs the - // traffic to the target that you specify in the forwarding rule. If you - // don't specify a reserved IP address, an ephemeral IP address is - // assigned. Methods for specifying an IP address: * IPv4 dotted - // decimal, as in `100.1.2.3` * Full URL, as in + // IPAddress: IP address for which this forwarding rule accepts traffic. + // When a client sends traffic to this IP address, the forwarding rule + // directs the traffic to the referenced target or backendService. While + // creating a forwarding rule, specifying an IPAddress is required under + // the following circumstances: - When the target is set to + // targetGrpcProxy and validateForProxyless is set to true, the + // IPAddress should be set to 0.0.0.0. - When the target is a Private + // Service Connect Google APIs bundle, you must specify an IPAddress. + // Otherwise, you can optionally specify an IP address that references + // an existing static (reserved) IP address resource. When omitted, + // Google Cloud assigns an ephemeral IP address. Use one of the + // following formats to specify an IP address while creating a + // forwarding rule: * IP address number, as in `100.1.2.3` * Full + // resource URL, as in // https://www.googleapis.com/compute/v1/projects/project_id/regions/region // /addresses/address-name * Partial URL or by name, as in: - // projects/project_id/regions/region/addresses/address-name - // regions/region/addresses/address-name - global/addresses/address-name - // - address-name The loadBalancingScheme and the forwarding rule's - // target determine the type of IP address that you can use. For - // detailed information, see IP address specifications + // - address-name The forwarding rule's target or backendService, and in + // most cases, also the loadBalancingScheme, determine the type of IP + // address that you can use. For detailed information, see IP address + // specifications // (https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). - // Must be set to `0.0.0.0` when the target is targetGrpcProxy that has - // validateForProxyless field set to true. For Private Service Connect - // forwarding rules that forward traffic to Google APIs, IP address must - // be provided. + // When reading an IPAddress, the API always returns the IP address + // number. IPAddress string `json:"IPAddress,omitempty"` // IPProtocol: The IP protocol to which this rule applies. For protocol @@ -17136,10 +17148,10 @@ type HostRule struct { // Hosts: The list of host patterns to match. They must be valid // hostnames with optional port numbers in the format host:port. * // matches any string of ([a-z0-9-.]*). In that case, * must be the - // first character and must be followed in the pattern by either - or .. - // * based matching is not supported when the URL map is bound to a - // target gRPC proxy that has the validateForProxyless field set to - // true. + // first character, and if followed by anything, the immediate following + // character must be either - or .. * based matching is not supported + // when the URL map is bound to a target gRPC proxy that has the + // validateForProxyless field set to true. Hosts []string `json:"hosts,omitempty"` // PathMatcher: The name of the PathMatcher to use to match the path @@ -18015,6 +18027,10 @@ type HttpRouteAction struct { // retry_policy is ignored by clients that are configured with a // fault_injection_policy if: 1. The traffic is generated by fault // injection AND 2. The fault injection is not a delay fault injection. + // Fault injection is not supported with the global external HTTP(S) + // load balancer (classic). To see which load balancers support fault + // injection, see Load balancing: Routing and traffic management + // features. FaultInjectionPolicy *HttpFaultInjection `json:"faultInjectionPolicy,omitempty"` // MaxStreamDuration: Specifies the maximum duration (timeout) for @@ -21349,13 +21365,17 @@ type InstanceGroupManagerUpdatePolicy struct { // 3600]. MinReadySec int64 `json:"minReadySec,omitempty"` - // MinimalAction: Minimal action to be taken on an instance. You can - // specify either RESTART to restart existing instances or REPLACE to - // delete and create new instances from the target template. If you - // specify a RESTART, the Updater will attempt to perform that action - // only. However, if the Updater determines that the minimal action you - // specify is not enough to perform the update, it might perform a more - // disruptive action. + // MinimalAction: Minimal action to be taken on an instance. Use this + // option to minimize disruption as much as possible or to apply a more + // disruptive action than is necessary. - To limit disruption as much as + // possible, set the minimal action to REFRESH. If your update requires + // a more disruptive action, Compute Engine performs the necessary + // action to execute the update. - To apply a more disruptive action + // than is strictly necessary, set the minimal action to RESTART or + // REPLACE. For example, Compute Engine does not need to restart a VM to + // change its metadata. But if your application reads instance metadata + // only when a VM is restarted, you can set the minimal action to + // RESTART in order to pick up metadata changes. // // Possible values: // "NONE" - Do not perform any action. @@ -44866,9 +44886,9 @@ func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) { // resource placement configuration. It specifies the failure bucket // separation as well as network locality type ResourcePolicyGroupPlacementPolicy struct { - // AvailabilityDomainCount: The number of availability domains instances - // will be spread across. If two instances are in different availability - // domain, they will not be put in the same low latency network + // AvailabilityDomainCount: The number of availability domains to spread + // instances across. If two instances are in different availability + // domain, they are not in the same low latency network. AvailabilityDomainCount int64 `json:"availabilityDomainCount,omitempty"` // Collocation: Specifies network collocation @@ -44906,7 +44926,10 @@ type ResourcePolicyGroupPlacementPolicy struct { // "UNSPECIFIED_PLACEMENT_TYPE" Style string `json:"style,omitempty"` - // VmCount: Number of vms in this placement group + // VmCount: Number of VMs in this placement group. Google does not + // recommend that you use this field unless you use a compact policy and + // you want your policy to work only if it contains this exact number of + // VMs. VmCount int64 `json:"vmCount,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -51635,6 +51658,10 @@ type Snapshot struct { // resource, this field is visible only if it has a non-empty value. ChainName string `json:"chainName,omitempty"` + // CreationSizeBytes: [Output Only] Size in bytes of the snapshot at + // creation time. + CreationSizeBytes int64 `json:"creationSizeBytes,omitempty,string"` + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` @@ -153763,6 +153790,196 @@ func (c *RegionBackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) } +// method id "compute.regionBackendServices.setSecurityPolicy": + +type RegionBackendServicesSetSecurityPolicyCall struct { + s *Service + project string + region string + backendService string + securitypolicyreference *SecurityPolicyReference + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetSecurityPolicy: Sets the Google Cloud Armor security policy for +// the specified backend service. For more information, see Google Cloud +// Armor Overview +// +// - backendService: Name of the BackendService resource to which the +// security policy should be set. The name should conform to RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) SetSecurityPolicy(project string, region string, backendService string, securitypolicyreference *SecurityPolicyReference) *RegionBackendServicesSetSecurityPolicyCall { + c := &RegionBackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.backendService = backendService + c.securitypolicyreference = securitypolicyreference + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionBackendServicesSetSecurityPolicyCall) RequestId(requestId string) *RegionBackendServicesSetSecurityPolicyCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionBackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetSecurityPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionBackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetSecurityPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "backendService": c.backendService, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionBackendServices.setSecurityPolicy" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionBackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview", + // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy", + // "httpMethod": "POST", + // "id": "compute.regionBackendServices.setSecurityPolicy", + // "parameterOrder": [ + // "project", + // "region", + // "backendService" + // ], + // "parameters": { + // "backendService": { + // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy", + // "request": { + // "$ref": "SecurityPolicyReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + // method id "compute.regionBackendServices.testIamPermissions": type RegionBackendServicesTestIamPermissionsCall struct { diff --git a/compute/v0.beta/compute-api.json b/compute/v0.beta/compute-api.json index de9436e24e5..20e7aa4939d 100644 --- a/compute/v0.beta/compute-api.json +++ b/compute/v0.beta/compute-api.json @@ -24816,6 +24816,361 @@ } } }, + "regionSslPolicies": { + "methods": { + "delete": { + "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + "httpMethod": "DELETE", + "id": "compute.regionSslPolicies.delete", + "parameterOrder": [ + "project", + "region", + "sslPolicy" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "sslPolicy": { + "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "description": "Lists all of the ordered rules present in a single specified policy.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + "httpMethod": "GET", + "id": "compute.regionSslPolicies.get", + "parameterOrder": [ + "project", + "region", + "sslPolicy" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "sslPolicy": { + "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + "response": { + "$ref": "SslPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "description": "Creates a new policy in the specified project and region using the data included in the request.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies", + "httpMethod": "POST", + "id": "compute.regionSslPolicies.insert", + "parameterOrder": [ + "project", + "region" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies", + "request": { + "$ref": "SslPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "description": "Lists all the SSL policies that have been configured for the specified project and region.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies", + "httpMethod": "GET", + "id": "compute.regionSslPolicies.list", + "parameterOrder": [ + "project", + "region" + ], + "parameters": { + "filter": { + "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", + "location": "query", + "type": "string" + }, + "maxResults": { + "default": "500", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "orderBy": { + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + "location": "query", + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "returnPartialSuccess": { + "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + "location": "query", + "type": "boolean" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies", + "response": { + "$ref": "SslPoliciesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listAvailableFeatures": { + "description": "Lists all features that can be specified in the SSL policy when using custom profile.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures", + "httpMethod": "GET", + "id": "compute.regionSslPolicies.listAvailableFeatures", + "parameterOrder": [ + "project", + "region" + ], + "parameters": { + "filter": { + "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", + "location": "query", + "type": "string" + }, + "maxResults": { + "default": "500", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "orderBy": { + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + "location": "query", + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "returnPartialSuccess": { + "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + "location": "query", + "type": "boolean" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures", + "response": { + "$ref": "SslPoliciesListAvailableFeaturesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "description": "Patches the specified SSL policy with the data included in the request.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + "httpMethod": "PATCH", + "id": "compute.regionSslPolicies.patch", + "parameterOrder": [ + "project", + "region", + "sslPolicy" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "sslPolicy": { + "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + "request": { + "$ref": "SslPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "testIamPermissions": { + "description": "Returns permissions that a caller has on the specified resource.", + "flatPath": "projects/{project}/regions/{region}/sslPolicies/{resource}/testIamPermissions", + "httpMethod": "POST", + "id": "compute.regionSslPolicies.testIamPermissions", + "parameterOrder": [ + "project", + "region", + "resource" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "The name of the region for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "resource": { + "description": "Name or id of the resource for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/sslPolicies/{resource}/testIamPermissions", + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "regionTargetHttpProxies": { "methods": { "delete": { @@ -29578,6 +29933,66 @@ }, "sslPolicies": { "methods": { + "aggregatedList": { + "description": "Retrieves the list of all SslPolicy resources, regional and global, available to the specified project.", + "flatPath": "projects/{project}/aggregated/sslPolicies", + "httpMethod": "GET", + "id": "compute.sslPolicies.aggregatedList", + "parameterOrder": [ + "project" + ], + "parameters": { + "filter": { + "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", + "location": "query", + "type": "string" + }, + "includeAllScopes": { + "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.", + "location": "query", + "type": "boolean" + }, + "maxResults": { + "default": "500", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "orderBy": { + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + "location": "query", + "type": "string" + }, + "project": { + "description": "Name of the project scoping this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "returnPartialSuccess": { + "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + "location": "query", + "type": "boolean" + } + }, + "path": "projects/{project}/aggregated/sslPolicies", + "response": { + "$ref": "SslPoliciesAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, "delete": { "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.", "flatPath": "projects/{project}/global/sslPolicies/{sslPolicy}", @@ -35037,7 +35452,7 @@ } } }, - "revision": "20220426", + "revision": "20220506", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -35621,6 +36036,7 @@ "IPSEC_INTERCONNECT", "NAT_AUTO", "PRIVATE_SERVICE_CONNECT", + "SERVERLESS", "SHARED_LOADBALANCER_VIP", "VPC_PEERING" ], @@ -35630,6 +36046,7 @@ "A regional internal IP address range reserved for the VLAN attachment that is used in IPsec-encrypted Cloud Interconnect. This regional internal IP address range must not overlap with any IP address range of subnet/route in the VPC network and its peering networks. After the VLAN attachment is created with the reserved IP address range, when creating a new VPN gateway, its interface IP address is allocated from the associated VLAN attachment’s IP address range.", "External IP automatically reserved for Cloud NAT.", "A private network IP address that can be used to configure Private Service Connect. This purpose can be specified only for GLOBAL addresses of Type INTERNAL", + "A regional internal IP address range reserved for Serverless.", "A private network IP address that can be shared by multiple Internal Load Balancer forwarding rules.", "IP range for peer networks." ], @@ -41941,7 +42358,7 @@ "id": "ForwardingRule", "properties": { "IPAddress": { - "description": "IP address that this forwarding rule serves. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the target that you specify in the forwarding rule. If you don't specify a reserved IP address, an ephemeral IP address is assigned. Methods for specifying an IP address: * IPv4 dotted decimal, as in `100.1.2.3` * Full URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The loadBalancingScheme and the forwarding rule's target determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). Must be set to `0.0.0.0` when the target is targetGrpcProxy that has validateForProxyless field set to true. For Private Service Connect forwarding rules that forward traffic to Google APIs, IP address must be provided.", + "description": "IP address for which this forwarding rule accepts traffic. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the referenced target or backendService. While creating a forwarding rule, specifying an IPAddress is required under the following circumstances: - When the target is set to targetGrpcProxy and validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0. - When the target is a Private Service Connect Google APIs bundle, you must specify an IPAddress. Otherwise, you can optionally specify an IP address that references an existing static (reserved) IP address resource. When omitted, Google Cloud assigns an ephemeral IP address. Use one of the following formats to specify an IP address while creating a forwarding rule: * IP address number, as in `100.1.2.3` * Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The forwarding rule's target or backendService, and in most cases, also the loadBalancingScheme, determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). When reading an IPAddress, the API always returns the IP address number.", "type": "string" }, "IPProtocol": { @@ -43699,7 +44116,7 @@ "type": "string" }, "hosts": { - "description": "The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.", + "description": "The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.", "items": { "type": "string" }, @@ -44157,7 +44574,7 @@ }, "faultInjectionPolicy": { "$ref": "HttpFaultInjection", - "description": "The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection." + "description": "The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the global external HTTP(S) load balancer (classic). To see which load balancers support fault injection, see Load balancing: Routing and traffic management features." }, "maxStreamDuration": { "$ref": "Duration", @@ -46198,7 +46615,7 @@ "type": "integer" }, "minimalAction": { - "description": "Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.", + "description": "Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action to REFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes. ", "enum": [ "NONE", "REFRESH", @@ -59185,7 +59602,7 @@ "id": "ResourcePolicyGroupPlacementPolicy", "properties": { "availabilityDomainCount": { - "description": "The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network", + "description": "The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network.", "format": "int32", "type": "integer" }, @@ -59202,7 +59619,7 @@ "type": "string" }, "vmCount": { - "description": "Number of vms in this placement group", + "description": "Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs.", "format": "int32", "type": "integer" } @@ -63863,36 +64280,210 @@ }, "type": "object" }, - "SslCertificateList": { - "description": "Contains a list of SslCertificate resources.", - "id": "SslCertificateList", + "SslCertificateList": { + "description": "Contains a list of SslCertificate resources.", + "id": "SslCertificateList", + "properties": { + "id": { + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { + "description": "A list of SslCertificate resources.", + "items": { + "$ref": "SslCertificate" + }, + "type": "array" + }, + "kind": { + "default": "compute#sslCertificateList", + "description": "Type of resource.", + "type": "string" + }, + "nextPageToken": { + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] Server-defined URL for this resource.", + "type": "string" + }, + "warning": { + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "LARGE_DEPLOYMENT_WARNING", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "When deploying a deployment with a exceedingly large number of resources", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "SslCertificateManagedSslCertificate": { + "description": "Configuration and status of a managed SSL certificate.", + "id": "SslCertificateManagedSslCertificate", "properties": { - "id": { - "description": "[Output Only] Unique identifier for the resource; defined by the server.", - "type": "string" + "domainStatus": { + "additionalProperties": { + "enum": [ + "ACTIVE", + "DOMAIN_STATUS_UNSPECIFIED", + "FAILED_CAA_CHECKING", + "FAILED_CAA_FORBIDDEN", + "FAILED_NOT_VISIBLE", + "FAILED_RATE_LIMITED", + "PROVISIONING" + ], + "enumDescriptions": [ + "A managed certificate can be provisioned, no issues for this domain.", + "", + "Failed to check CAA records for the domain.", + "Certificate issuance forbidden by an explicit CAA record for the domain.", + "There seems to be problem with the user's DNS or load balancer configuration for this domain.", + "Reached rate-limit for certificates per top-level private domain.", + "Certificate provisioning for this domain is under way. GCP will attempt to provision the first certificate." + ], + "type": "string" + }, + "description": "[Output only] Detailed statuses of the domains specified for managed certificate resource.", + "type": "object" }, - "items": { - "description": "A list of SslCertificate resources.", + "domains": { + "description": "The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates).", "items": { - "$ref": "SslCertificate" + "type": "string" }, "type": "array" }, - "kind": { - "default": "compute#sslCertificateList", - "description": "Type of resource.", + "status": { + "description": "[Output only] Status of the managed certificate resource.", + "enum": [ + "ACTIVE", + "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED", + "PROVISIONING", + "PROVISIONING_FAILED", + "PROVISIONING_FAILED_PERMANENTLY", + "RENEWAL_FAILED" + ], + "enumDescriptions": [ + "The certificate management is working, and a certificate has been provisioned.", + "", + "The certificate management is working. GCP will attempt to provision the first certificate.", + "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. For details of which domain failed, consult domain_status field.", + "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. It won't be retried. To try again delete and create a new managed SslCertificate resource. For details of which domain failed, consult domain_status field.", + "Renewal of the certificate has failed due to an issue with the DNS or load balancing configuration. The existing cert is still serving; however, it will expire shortly. To provision a renewed certificate, delete and create a new managed SslCertificate resource. For details on which domain failed, consult domain_status field." + ], "type": "string" - }, - "nextPageToken": { - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + } + }, + "type": "object" + }, + "SslCertificateSelfManagedSslCertificate": { + "description": "Configuration and status of a self-managed SSL certificate.", + "id": "SslCertificateSelfManagedSslCertificate", + "properties": { + "certificate": { + "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.", "type": "string" }, - "selfLink": { - "description": "[Output Only] Server-defined URL for this resource.", + "privateKey": { + "description": "A write-only private key in PEM format. Only insert requests will include this field.", "type": "string" + } + }, + "type": "object" + }, + "SslCertificatesScopedList": { + "id": "SslCertificatesScopedList", + "properties": { + "sslCertificates": { + "description": "List of SslCertificates contained in this scope.", + "items": { + "$ref": "SslCertificate" + }, + "type": "array" }, "warning": { - "description": "[Output Only] Informational warning message.", + "description": "Informational warning which replaces the list of backend services when the list is empty.", "properties": { "code": { "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", @@ -63981,92 +64572,46 @@ }, "type": "object" }, - "SslCertificateManagedSslCertificate": { - "description": "Configuration and status of a managed SSL certificate.", - "id": "SslCertificateManagedSslCertificate", + "SslPoliciesAggregatedList": { + "id": "SslPoliciesAggregatedList", "properties": { - "domainStatus": { + "etag": { + "type": "string" + }, + "id": { + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { "additionalProperties": { - "enum": [ - "ACTIVE", - "DOMAIN_STATUS_UNSPECIFIED", - "FAILED_CAA_CHECKING", - "FAILED_CAA_FORBIDDEN", - "FAILED_NOT_VISIBLE", - "FAILED_RATE_LIMITED", - "PROVISIONING" - ], - "enumDescriptions": [ - "A managed certificate can be provisioned, no issues for this domain.", - "", - "Failed to check CAA records for the domain.", - "Certificate issuance forbidden by an explicit CAA record for the domain.", - "There seems to be problem with the user's DNS or load balancer configuration for this domain.", - "Reached rate-limit for certificates per top-level private domain.", - "Certificate provisioning for this domain is under way. GCP will attempt to provision the first certificate." - ], - "type": "string" + "$ref": "SslPoliciesScopedList", + "description": "Name of the scope containing this set of SSL policies." }, - "description": "[Output only] Detailed statuses of the domains specified for managed certificate resource.", + "description": "A list of SslPoliciesScopedList resources.", "type": "object" }, - "domains": { - "description": "The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates).", - "items": { - "type": "string" - }, - "type": "array" - }, - "status": { - "description": "[Output only] Status of the managed certificate resource.", - "enum": [ - "ACTIVE", - "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED", - "PROVISIONING", - "PROVISIONING_FAILED", - "PROVISIONING_FAILED_PERMANENTLY", - "RENEWAL_FAILED" - ], - "enumDescriptions": [ - "The certificate management is working, and a certificate has been provisioned.", - "", - "The certificate management is working. GCP will attempt to provision the first certificate.", - "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. For details of which domain failed, consult domain_status field.", - "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. It won't be retried. To try again delete and create a new managed SslCertificate resource. For details of which domain failed, consult domain_status field.", - "Renewal of the certificate has failed due to an issue with the DNS or load balancing configuration. The existing cert is still serving; however, it will expire shortly. To provision a renewed certificate, delete and create a new managed SslCertificate resource. For details on which domain failed, consult domain_status field." - ], + "kind": { + "default": "compute#sslPoliciesAggregatedList", + "description": "[Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies.", "type": "string" - } - }, - "type": "object" - }, - "SslCertificateSelfManagedSslCertificate": { - "description": "Configuration and status of a self-managed SSL certificate.", - "id": "SslCertificateSelfManagedSslCertificate", - "properties": { - "certificate": { - "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.", + }, + "nextPageToken": { + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", "type": "string" }, - "privateKey": { - "description": "A write-only private key in PEM format. Only insert requests will include this field.", + "selfLink": { + "description": "[Output Only] Server-defined URL for this resource.", "type": "string" - } - }, - "type": "object" - }, - "SslCertificatesScopedList": { - "id": "SslCertificatesScopedList", - "properties": { - "sslCertificates": { - "description": "List of SslCertificates contained in this scope.", + }, + "unreachables": { + "description": "[Output Only] Unreachable resources.", "items": { - "$ref": "SslCertificate" + "type": "string" }, "type": "array" }, "warning": { - "description": "Informational warning which replaces the list of backend services when the list is empty.", + "description": "[Output Only] Informational warning message.", "properties": { "code": { "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", @@ -64284,6 +64829,106 @@ }, "type": "object" }, + "SslPoliciesScopedList": { + "id": "SslPoliciesScopedList", + "properties": { + "sslPolicies": { + "description": "A list of SslPolicies contained in this scope.", + "items": { + "$ref": "SslPolicy" + }, + "type": "array" + }, + "warning": { + "description": "Informational warning which replaces the list of SSL policies when the list is empty.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "LARGE_DEPLOYMENT_WARNING", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "When deploying a deployment with a exceedingly large number of resources", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, "SslPolicy": { "description": "Represents an SSL Policy resource. Use SSL policies to control the SSL features, such as versions and cipher suites, offered by an HTTPS or SSL Proxy load balancer. For more information, read SSL Policy Concepts.", "id": "SslPolicy", @@ -64360,6 +65005,10 @@ ], "type": "string" }, + "region": { + "description": "[Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies.", + "type": "string" + }, "selfLink": { "description": "[Output Only] Server-defined URL for the resource.", "type": "string" diff --git a/compute/v0.beta/compute-gen.go b/compute/v0.beta/compute-gen.go index 2d67aebe311..0f922016161 100644 --- a/compute/v0.beta/compute-gen.go +++ b/compute/v0.beta/compute-gen.go @@ -205,6 +205,7 @@ func New(client *http.Client) (*Service, error) { s.RegionOperations = NewRegionOperationsService(s) s.RegionSecurityPolicies = NewRegionSecurityPoliciesService(s) s.RegionSslCertificates = NewRegionSslCertificatesService(s) + s.RegionSslPolicies = NewRegionSslPoliciesService(s) s.RegionTargetHttpProxies = NewRegionTargetHttpProxiesService(s) s.RegionTargetHttpsProxies = NewRegionTargetHttpsProxiesService(s) s.RegionTargetTcpProxies = NewRegionTargetTcpProxiesService(s) @@ -363,6 +364,8 @@ type Service struct { RegionSslCertificates *RegionSslCertificatesService + RegionSslPolicies *RegionSslPoliciesService + RegionTargetHttpProxies *RegionTargetHttpProxiesService RegionTargetHttpsProxies *RegionTargetHttpsProxiesService @@ -976,6 +979,15 @@ type RegionSslCertificatesService struct { s *Service } +func NewRegionSslPoliciesService(s *Service) *RegionSslPoliciesService { + rs := &RegionSslPoliciesService{s: s} + return rs +} + +type RegionSslPoliciesService struct { + s *Service +} + func NewRegionTargetHttpProxiesService(s *Service) *RegionTargetHttpProxiesService { rs := &RegionTargetHttpProxiesService{s: s} return rs @@ -2105,6 +2117,8 @@ type Address struct { // "PRIVATE_SERVICE_CONNECT" - A private network IP address that can // be used to configure Private Service Connect. This purpose can be // specified only for GLOBAL addresses of Type INTERNAL + // "SERVERLESS" - A regional internal IP address range reserved for + // Serverless. // "SHARED_LOADBALANCER_VIP" - A private network IP address that can // be shared by multiple Internal Load Balancer forwarding rules. // "VPC_PEERING" - IP range for peer networks. @@ -12300,24 +12314,31 @@ func (s *FixedOrPercent) MarshalJSON() ([]byte, error) { // Classic gateways (targetVpnGateway). For more information, read // Forwarding rule concepts and Using protocol forwarding. type ForwardingRule struct { - // IPAddress: IP address that this forwarding rule serves. When a client - // sends traffic to this IP address, the forwarding rule directs the - // traffic to the target that you specify in the forwarding rule. If you - // don't specify a reserved IP address, an ephemeral IP address is - // assigned. Methods for specifying an IP address: * IPv4 dotted - // decimal, as in `100.1.2.3` * Full URL, as in + // IPAddress: IP address for which this forwarding rule accepts traffic. + // When a client sends traffic to this IP address, the forwarding rule + // directs the traffic to the referenced target or backendService. While + // creating a forwarding rule, specifying an IPAddress is required under + // the following circumstances: - When the target is set to + // targetGrpcProxy and validateForProxyless is set to true, the + // IPAddress should be set to 0.0.0.0. - When the target is a Private + // Service Connect Google APIs bundle, you must specify an IPAddress. + // Otherwise, you can optionally specify an IP address that references + // an existing static (reserved) IP address resource. When omitted, + // Google Cloud assigns an ephemeral IP address. Use one of the + // following formats to specify an IP address while creating a + // forwarding rule: * IP address number, as in `100.1.2.3` * Full + // resource URL, as in // https://www.googleapis.com/compute/v1/projects/project_id/regions/region // /addresses/address-name * Partial URL or by name, as in: - // projects/project_id/regions/region/addresses/address-name - // regions/region/addresses/address-name - global/addresses/address-name - // - address-name The loadBalancingScheme and the forwarding rule's - // target determine the type of IP address that you can use. For - // detailed information, see IP address specifications + // - address-name The forwarding rule's target or backendService, and in + // most cases, also the loadBalancingScheme, determine the type of IP + // address that you can use. For detailed information, see IP address + // specifications // (https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). - // Must be set to `0.0.0.0` when the target is targetGrpcProxy that has - // validateForProxyless field set to true. For Private Service Connect - // forwarding rules that forward traffic to Google APIs, IP address must - // be provided. + // When reading an IPAddress, the API always returns the IP address + // number. IPAddress string `json:"IPAddress,omitempty"` // IPProtocol: The IP protocol to which this rule applies. For protocol @@ -15043,10 +15064,10 @@ type HostRule struct { // Hosts: The list of host patterns to match. They must be valid // hostnames with optional port numbers in the format host:port. * // matches any string of ([a-z0-9-.]*). In that case, * must be the - // first character and must be followed in the pattern by either - or .. - // * based matching is not supported when the URL map is bound to a - // target gRPC proxy that has the validateForProxyless field set to - // true. + // first character, and if followed by anything, the immediate following + // character must be either - or .. * based matching is not supported + // when the URL map is bound to a target gRPC proxy that has the + // validateForProxyless field set to true. Hosts []string `json:"hosts,omitempty"` // PathMatcher: The name of the PathMatcher to use to match the path @@ -15918,6 +15939,10 @@ type HttpRouteAction struct { // retry_policy is ignored by clients that are configured with a // fault_injection_policy if: 1. The traffic is generated by fault // injection AND 2. The fault injection is not a delay fault injection. + // Fault injection is not supported with the global external HTTP(S) + // load balancer (classic). To see which load balancers support fault + // injection, see Load balancing: Routing and traffic management + // features. FaultInjectionPolicy *HttpFaultInjection `json:"faultInjectionPolicy,omitempty"` // MaxStreamDuration: Specifies the maximum duration (timeout) for @@ -18991,13 +19016,17 @@ type InstanceGroupManagerUpdatePolicy struct { // 3600]. MinReadySec int64 `json:"minReadySec,omitempty"` - // MinimalAction: Minimal action to be taken on an instance. You can - // specify either RESTART to restart existing instances or REPLACE to - // delete and create new instances from the target template. If you - // specify a RESTART, the Updater will attempt to perform that action - // only. However, if the Updater determines that the minimal action you - // specify is not enough to perform the update, it might perform a more - // disruptive action. + // MinimalAction: Minimal action to be taken on an instance. Use this + // option to minimize disruption as much as possible or to apply a more + // disruptive action than is necessary. - To limit disruption as much as + // possible, set the minimal action to REFRESH. If your update requires + // a more disruptive action, Compute Engine performs the necessary + // action to execute the update. - To apply a more disruptive action + // than is strictly necessary, set the minimal action to RESTART or + // REPLACE. For example, Compute Engine does not need to restart a VM to + // change its metadata. But if your application reads instance metadata + // only when a VM is restarted, you can set the minimal action to + // RESTART in order to pick up metadata changes. // // Possible values: // "NONE" - Do not perform any action. @@ -39495,9 +39524,9 @@ func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) { // resource placement configuration. It specifies the failure bucket // separation as well as network locality type ResourcePolicyGroupPlacementPolicy struct { - // AvailabilityDomainCount: The number of availability domains instances - // will be spread across. If two instances are in different availability - // domain, they will not be put in the same low latency network + // AvailabilityDomainCount: The number of availability domains to spread + // instances across. If two instances are in different availability + // domain, they are not in the same low latency network. AvailabilityDomainCount int64 `json:"availabilityDomainCount,omitempty"` // Collocation: Specifies network collocation @@ -39507,7 +39536,10 @@ type ResourcePolicyGroupPlacementPolicy struct { // "UNSPECIFIED_COLLOCATION" Collocation string `json:"collocation,omitempty"` - // VmCount: Number of vms in this placement group + // VmCount: Number of VMs in this placement group. Google does not + // recommend that you use this field unless you use a compact policy and + // you want your policy to work only if it contains this exact number of + // VMs. VmCount int64 `json:"vmCount,omitempty"` // ForceSendFields is a list of field names (e.g. @@ -46930,6 +46962,197 @@ func (s *SslCertificatesScopedListWarningData) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +type SslPoliciesAggregatedList struct { + Etag string `json:"etag,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of SslPoliciesScopedList resources. + Items map[string]SslPoliciesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#sslPolicyAggregatedList for lists of SSL Policies. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] This token allows you to get the next + // page of results for list requests. If the number of results is larger + // than maxResults, use the nextPageToken as a value for the query + // parameter pageToken in the next list request. Subsequent list + // requests will have their own nextPageToken to continue paging through + // the results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Unreachables: [Output Only] Unreachable resources. + Unreachables []string `json:"unreachables,omitempty"` + + // Warning: [Output Only] Informational warning message. + Warning *SslPoliciesAggregatedListWarning `json:"warning,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SslPoliciesAggregatedList) MarshalJSON() ([]byte, error) { + type NoMethod SslPoliciesAggregatedList + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SslPoliciesAggregatedListWarning: [Output Only] Informational warning +// message. +type SslPoliciesAggregatedListWarning struct { + // Code: [Output Only] A warning code, if applicable. For example, + // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in + // the response. + // + // Possible values: + // "CLEANUP_FAILED" - Warning about failed cleanup of transient + // changes made by a failed operation. + // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was + // created. + // "DEPRECATED_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as deprecated + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk + // that is larger than image size. + // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as experimental + // "EXTERNAL_API_WARNING" - Warning that is present in an external api + // call + // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been + // overridden. Deprecated unused field. + // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an + // injected kernel, which is deprecated. + // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a + // exceedingly large number of resources + // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is + // not assigned to an instance on the network. + // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot + // ip forward. + // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's + // nextHopInstance URL refers to an instance that does not have an ipv6 + // interface on the same network as the route. + // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL + // refers to an instance that does not exist. + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance + // URL refers to an instance that is not on the same network as the + // route. + // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not + // have a status of RUNNING. + // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to + // continue the process despite the mentioned error. + // "NO_RESULTS_ON_PAGE" - No results are present on a particular list + // page. + // "PARTIAL_SUCCESS" - Success is reported, but some results may be + // missing due to errors + // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource + // that requires a TOS they have not accepted. + // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a + // resource is in use. + // "RESOURCE_NOT_DELETED" - One or more of the resources set to + // auto-delete could not be deleted because they were in use. + // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is + // ignored. + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in + // instance group manager is valid as such, but its application does not + // make a lot of sense, because it allows only single instance in + // instance group. + // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema + // are present + // "UNREACHABLE" - A given scope cannot be reached. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata about this warning in key: value format. + // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" + // } + Data []*SslPoliciesAggregatedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] A human-readable description of the warning + // code. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Code") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SslPoliciesAggregatedListWarning) MarshalJSON() ([]byte, error) { + type NoMethod SslPoliciesAggregatedListWarning + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SslPoliciesAggregatedListWarningData struct { + // Key: [Output Only] A key that provides more detail on the warning + // being returned. For example, for warnings where there are no results + // in a list request for a particular zone, this key might be scope and + // the key value might be the zone name. Other examples might be a key + // indicating a deprecated resource and a suggested replacement, or a + // warning about invalid network settings (for example, if an instance + // attempts to perform IP forwarding but is not enabled for IP + // forwarding). + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Key") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SslPoliciesAggregatedListWarningData) MarshalJSON() ([]byte, error) { + type NoMethod SslPoliciesAggregatedListWarningData + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + type SslPoliciesList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -47145,120 +47368,288 @@ func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SslPolicy: Represents an SSL Policy resource. Use SSL policies to -// control the SSL features, such as versions and cipher suites, offered -// by an HTTPS or SSL Proxy load balancer. For more information, read -// SSL Policy Concepts. -type SslPolicy struct { - // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text - // format. - CreationTimestamp string `json:"creationTimestamp,omitempty"` - - // CustomFeatures: A list of features enabled when the selected profile - // is CUSTOM. The method returns the set of features that can be - // specified in this list. This field must be empty if the profile is - // not CUSTOM. - CustomFeatures []string `json:"customFeatures,omitempty"` - - // Description: An optional description of this resource. Provide this - // property when you create the resource. - Description string `json:"description,omitempty"` - - // EnabledFeatures: [Output Only] The list of features enabled in the - // SSL policy. - EnabledFeatures []string `json:"enabledFeatures,omitempty"` - - // Fingerprint: Fingerprint of this resource. A hash of the contents - // stored in this object. This field is used in optimistic locking. This - // field will be ignored when inserting a SslPolicy. An up-to-date - // fingerprint must be provided in order to update the SslPolicy, - // otherwise the request will fail with error 412 conditionNotMet. To - // see the latest fingerprint, make a get() request to retrieve an - // SslPolicy. - Fingerprint string `json:"fingerprint,omitempty"` - - // Id: [Output Only] The unique identifier for the resource. This - // identifier is defined by the server. - Id uint64 `json:"id,omitempty,string"` - - // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor - // SSL policies. - Kind string `json:"kind,omitempty"` +type SslPoliciesScopedList struct { + // SslPolicies: A list of SslPolicies contained in this scope. + SslPolicies []*SslPolicy `json:"sslPolicies,omitempty"` - // MinTlsVersion: The minimum version of SSL protocol that can be used - // by the clients to establish a connection with the load balancer. This - // can be one of TLS_1_0, TLS_1_1, TLS_1_2. - // - // Possible values: - // "TLS_1_0" - TLS 1.0 - // "TLS_1_1" - TLS 1.1 - // "TLS_1_2" - TLS 1.2 - MinTlsVersion string `json:"minTlsVersion,omitempty"` - - // Name: Name of the resource. The name must be 1-63 characters long, - // and comply with RFC1035. Specifically, the name must be 1-63 - // characters long and match the regular expression - // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be - // a lowercase letter, and all following characters must be a dash, - // lowercase letter, or digit, except the last character, which cannot - // be a dash. - Name string `json:"name,omitempty"` - - // Profile: Profile specifies the set of SSL features that can be used - // by the load balancer when negotiating SSL with clients. This can be - // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, - // the set of SSL features to enable must be specified in the - // customFeatures field. - // - // Possible values: - // "COMPATIBLE" - Compatible profile. Allows the broadset set of - // clients, even those which support only out-of-date SSL features to - // negotiate with the load balancer. - // "CUSTOM" - Custom profile. Allow only the set of allowed SSL - // features specified in the customFeatures field. - // "MODERN" - Modern profile. Supports a wide set of SSL features, - // allowing modern clients to negotiate SSL with the load balancer. - // "RESTRICTED" - Restricted profile. Supports a reduced set of SSL - // features, intended to meet stricter compliance requirements. - Profile string `json:"profile,omitempty"` - - // SelfLink: [Output Only] Server-defined URL for the resource. - SelfLink string `json:"selfLink,omitempty"` - - // Warnings: [Output Only] If potential misconfigurations are detected - // for this SSL policy, this field will be populated with warning - // messages. - Warnings []*SslPolicyWarnings `json:"warnings,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // Warning: Informational warning which replaces the list of SSL + // policies when the list is empty. + Warning *SslPoliciesScopedListWarning `json:"warning,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreationTimestamp") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "SslPolicies") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreationTimestamp") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "SslPolicies") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *SslPolicy) MarshalJSON() ([]byte, error) { - type NoMethod SslPolicy +func (s *SslPoliciesScopedList) MarshalJSON() ([]byte, error) { + type NoMethod SslPoliciesScopedList raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -type SslPolicyWarnings struct { +// SslPoliciesScopedListWarning: Informational warning which replaces +// the list of SSL policies when the list is empty. +type SslPoliciesScopedListWarning struct { + // Code: [Output Only] A warning code, if applicable. For example, + // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in + // the response. + // + // Possible values: + // "CLEANUP_FAILED" - Warning about failed cleanup of transient + // changes made by a failed operation. + // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was + // created. + // "DEPRECATED_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as deprecated + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk + // that is larger than image size. + // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as experimental + // "EXTERNAL_API_WARNING" - Warning that is present in an external api + // call + // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been + // overridden. Deprecated unused field. + // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an + // injected kernel, which is deprecated. + // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a + // exceedingly large number of resources + // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is + // not assigned to an instance on the network. + // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot + // ip forward. + // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's + // nextHopInstance URL refers to an instance that does not have an ipv6 + // interface on the same network as the route. + // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL + // refers to an instance that does not exist. + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance + // URL refers to an instance that is not on the same network as the + // route. + // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not + // have a status of RUNNING. + // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to + // continue the process despite the mentioned error. + // "NO_RESULTS_ON_PAGE" - No results are present on a particular list + // page. + // "PARTIAL_SUCCESS" - Success is reported, but some results may be + // missing due to errors + // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource + // that requires a TOS they have not accepted. + // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a + // resource is in use. + // "RESOURCE_NOT_DELETED" - One or more of the resources set to + // auto-delete could not be deleted because they were in use. + // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is + // ignored. + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in + // instance group manager is valid as such, but its application does not + // make a lot of sense, because it allows only single instance in + // instance group. + // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema + // are present + // "UNREACHABLE" - A given scope cannot be reached. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata about this warning in key: value format. + // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" + // } + Data []*SslPoliciesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] A human-readable description of the warning + // code. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Code") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SslPoliciesScopedListWarning) MarshalJSON() ([]byte, error) { + type NoMethod SslPoliciesScopedListWarning + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SslPoliciesScopedListWarningData struct { + // Key: [Output Only] A key that provides more detail on the warning + // being returned. For example, for warnings where there are no results + // in a list request for a particular zone, this key might be scope and + // the key value might be the zone name. Other examples might be a key + // indicating a deprecated resource and a suggested replacement, or a + // warning about invalid network settings (for example, if an instance + // attempts to perform IP forwarding but is not enabled for IP + // forwarding). + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Key") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SslPoliciesScopedListWarningData) MarshalJSON() ([]byte, error) { + type NoMethod SslPoliciesScopedListWarningData + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SslPolicy: Represents an SSL Policy resource. Use SSL policies to +// control the SSL features, such as versions and cipher suites, offered +// by an HTTPS or SSL Proxy load balancer. For more information, read +// SSL Policy Concepts. +type SslPolicy struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // CustomFeatures: A list of features enabled when the selected profile + // is CUSTOM. The method returns the set of features that can be + // specified in this list. This field must be empty if the profile is + // not CUSTOM. + CustomFeatures []string `json:"customFeatures,omitempty"` + + // Description: An optional description of this resource. Provide this + // property when you create the resource. + Description string `json:"description,omitempty"` + + // EnabledFeatures: [Output Only] The list of features enabled in the + // SSL policy. + EnabledFeatures []string `json:"enabledFeatures,omitempty"` + + // Fingerprint: Fingerprint of this resource. A hash of the contents + // stored in this object. This field is used in optimistic locking. This + // field will be ignored when inserting a SslPolicy. An up-to-date + // fingerprint must be provided in order to update the SslPolicy, + // otherwise the request will fail with error 412 conditionNotMet. To + // see the latest fingerprint, make a get() request to retrieve an + // SslPolicy. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] The unique identifier for the resource. This + // identifier is defined by the server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor + // SSL policies. + Kind string `json:"kind,omitempty"` + + // MinTlsVersion: The minimum version of SSL protocol that can be used + // by the clients to establish a connection with the load balancer. This + // can be one of TLS_1_0, TLS_1_1, TLS_1_2. + // + // Possible values: + // "TLS_1_0" - TLS 1.0 + // "TLS_1_1" - TLS 1.1 + // "TLS_1_2" - TLS 1.2 + MinTlsVersion string `json:"minTlsVersion,omitempty"` + + // Name: Name of the resource. The name must be 1-63 characters long, + // and comply with RFC1035. Specifically, the name must be 1-63 + // characters long and match the regular expression + // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be + // a lowercase letter, and all following characters must be a dash, + // lowercase letter, or digit, except the last character, which cannot + // be a dash. + Name string `json:"name,omitempty"` + + // Profile: Profile specifies the set of SSL features that can be used + // by the load balancer when negotiating SSL with clients. This can be + // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, + // the set of SSL features to enable must be specified in the + // customFeatures field. + // + // Possible values: + // "COMPATIBLE" - Compatible profile. Allows the broadset set of + // clients, even those which support only out-of-date SSL features to + // negotiate with the load balancer. + // "CUSTOM" - Custom profile. Allow only the set of allowed SSL + // features specified in the customFeatures field. + // "MODERN" - Modern profile. Supports a wide set of SSL features, + // allowing modern clients to negotiate SSL with the load balancer. + // "RESTRICTED" - Restricted profile. Supports a reduced set of SSL + // features, intended to meet stricter compliance requirements. + Profile string `json:"profile,omitempty"` + + // Region: [Output Only] URL of the region where the regional SSL policy + // resides. This field is not applicable to global SSL policies. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Warnings: [Output Only] If potential misconfigurations are detected + // for this SSL policy, this field will be populated with warning + // messages. + Warnings []*SslPolicyWarnings `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreationTimestamp") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SslPolicy) MarshalJSON() ([]byte, error) { + type NoMethod SslPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SslPolicyWarnings struct { // Code: [Output Only] A warning code, if applicable. For example, // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in // the response. @@ -159883,6 +160274,1433 @@ func (c *RegionSslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallO } +// method id "compute.regionSslPolicies.delete": + +type RegionSslPoliciesDeleteCall struct { + s *Service + project string + region string + sslPolicy string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified SSL policy. The SSL policy resource can +// be deleted only if it is not in use by any TargetHttpsProxy or +// TargetSslProxy resources. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +// - sslPolicy: Name of the SSL policy to delete. The name must be 1-63 +// characters long, and comply with RFC1035. +func (r *RegionSslPoliciesService) Delete(project string, region string, sslPolicy string) *RegionSslPoliciesDeleteCall { + c := &RegionSslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.sslPolicy = sslPolicy + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionSslPoliciesDeleteCall) RequestId(requestId string) *RegionSslPoliciesDeleteCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesDeleteCall) Fields(s ...googleapi.Field) *RegionSslPoliciesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesDeleteCall) Context(ctx context.Context) *RegionSslPoliciesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "sslPolicy": c.sslPolicy, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionSslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + // "httpMethod": "DELETE", + // "id": "compute.regionSslPolicies.delete", + // "parameterOrder": [ + // "project", + // "region", + // "sslPolicy" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // }, + // "sslPolicy": { + // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionSslPolicies.get": + +type RegionSslPoliciesGetCall struct { + s *Service + project string + region string + sslPolicy string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Lists all of the ordered rules present in a single specified +// policy. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +// - sslPolicy: Name of the SSL policy to update. The name must be 1-63 +// characters long, and comply with RFC1035. +func (r *RegionSslPoliciesService) Get(project string, region string, sslPolicy string) *RegionSslPoliciesGetCall { + c := &RegionSslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.sslPolicy = sslPolicy + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesGetCall) Fields(s ...googleapi.Field) *RegionSslPoliciesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionSslPoliciesGetCall) IfNoneMatch(entityTag string) *RegionSslPoliciesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesGetCall) Context(ctx context.Context) *RegionSslPoliciesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "sslPolicy": c.sslPolicy, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.get" call. +// Exactly one of *SslPolicy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SslPolicy.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionSslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslPolicy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the ordered rules present in a single specified policy.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + // "httpMethod": "GET", + // "id": "compute.regionSslPolicies.get", + // "parameterOrder": [ + // "project", + // "region", + // "sslPolicy" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "sslPolicy": { + // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + // "response": { + // "$ref": "SslPolicy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regionSslPolicies.insert": + +type RegionSslPoliciesInsertCall struct { + s *Service + project string + region string + sslpolicy *SslPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates a new policy in the specified project and region +// using the data included in the request. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionSslPoliciesService) Insert(project string, region string, sslpolicy *SslPolicy) *RegionSslPoliciesInsertCall { + c := &RegionSslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.sslpolicy = sslpolicy + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionSslPoliciesInsertCall) RequestId(requestId string) *RegionSslPoliciesInsertCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesInsertCall) Fields(s ...googleapi.Field) *RegionSslPoliciesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesInsertCall) Context(ctx context.Context) *RegionSslPoliciesInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionSslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new policy in the specified project and region using the data included in the request.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies", + // "httpMethod": "POST", + // "id": "compute.regionSslPolicies.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies", + // "request": { + // "$ref": "SslPolicy" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionSslPolicies.list": + +type RegionSslPoliciesListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all the SSL policies that have been configured for the +// specified project and region. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionSslPoliciesService) List(project string, region string) *RegionSslPoliciesListCall { + c := &RegionSslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. The expression must specify +// the field name, an operator, and the value that you want to use for +// filtering. The value must be a string, a number, or a boolean. The +// operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For +// example, if you are filtering Compute Engine instances, you can +// exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:` operator can be used with string fields to +// match substrings. For non-string fields it is equivalent to the `=` +// operator. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label +// use: ``` labels.owner:* ``` You can also filter nested fields. For +// example, you could specify `scheduling.automaticRestart = false` to +// include instances only if they are not scheduled for automatic +// restarts. You can use filtering on nested fields to filter based on +// resource labels. To filter on multiple expressions, provide each +// separate expression within parentheses. For example: ``` +// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") +// ``` By default, each expression is an `AND` expression. However, you +// can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") +// AND (scheduling.automaticRestart = true) ``` +func (c *RegionSslPoliciesListCall) Filter(filter string) *RegionSslPoliciesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results per page that should be returned. If the number of +// available results is larger than `maxResults`, Compute Engine returns +// a `nextPageToken` that can be used to get the next page of results in +// subsequent list requests. Acceptable values are `0` to `500`, +// inclusive. (Default: `500`) +func (c *RegionSslPoliciesListCall) MaxResults(maxResults int64) *RegionSslPoliciesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. You can also sort results in +// descending order based on the creation timestamp using +// `orderBy="creationTimestamp desc". This sorts results based on the +// `creationTimestamp` field in reverse chronological order (newest +// result first). Use this to sort resources like operations so that the +// newest operation is returned first. Currently, only sorting by `name` +// or `creationTimestamp desc` is supported. +func (c *RegionSslPoliciesListCall) OrderBy(orderBy string) *RegionSslPoliciesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Set `pageToken` to the `nextPageToken` returned by a +// previous list request to get the next page of results. +func (c *RegionSslPoliciesListCall) PageToken(pageToken string) *RegionSslPoliciesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter +// "returnPartialSuccess": Opt-in for partial success behavior which +// provides partial results in case of failure. The default value is +// false. +func (c *RegionSslPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionSslPoliciesListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesListCall) Fields(s ...googleapi.Field) *RegionSslPoliciesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionSslPoliciesListCall) IfNoneMatch(entityTag string) *RegionSslPoliciesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesListCall) Context(ctx context.Context) *RegionSslPoliciesListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.list" call. +// Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SslPoliciesList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionSslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslPoliciesList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the SSL policies that have been configured for the specified project and region.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies", + // "httpMethod": "GET", + // "id": "compute.regionSslPolicies.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "returnPartialSuccess": { + // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies", + // "response": { + // "$ref": "SslPoliciesList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionSslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "compute.regionSslPolicies.listAvailableFeatures": + +type RegionSslPoliciesListAvailableFeaturesCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListAvailableFeatures: Lists all features that can be specified in +// the SSL policy when using custom profile. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionSslPoliciesService) ListAvailableFeatures(project string, region string) *RegionSslPoliciesListAvailableFeaturesCall { + c := &RegionSslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. The expression must specify +// the field name, an operator, and the value that you want to use for +// filtering. The value must be a string, a number, or a boolean. The +// operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For +// example, if you are filtering Compute Engine instances, you can +// exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:` operator can be used with string fields to +// match substrings. For non-string fields it is equivalent to the `=` +// operator. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label +// use: ``` labels.owner:* ``` You can also filter nested fields. For +// example, you could specify `scheduling.automaticRestart = false` to +// include instances only if they are not scheduled for automatic +// restarts. You can use filtering on nested fields to filter based on +// resource labels. To filter on multiple expressions, provide each +// separate expression within parentheses. For example: ``` +// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") +// ``` By default, each expression is an `AND` expression. However, you +// can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") +// AND (scheduling.automaticRestart = true) ``` +func (c *RegionSslPoliciesListAvailableFeaturesCall) Filter(filter string) *RegionSslPoliciesListAvailableFeaturesCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results per page that should be returned. If the number of +// available results is larger than `maxResults`, Compute Engine returns +// a `nextPageToken` that can be used to get the next page of results in +// subsequent list requests. Acceptable values are `0` to `500`, +// inclusive. (Default: `500`) +func (c *RegionSslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *RegionSslPoliciesListAvailableFeaturesCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. You can also sort results in +// descending order based on the creation timestamp using +// `orderBy="creationTimestamp desc". This sorts results based on the +// `creationTimestamp` field in reverse chronological order (newest +// result first). Use this to sort resources like operations so that the +// newest operation is returned first. Currently, only sorting by `name` +// or `creationTimestamp desc` is supported. +func (c *RegionSslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *RegionSslPoliciesListAvailableFeaturesCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Set `pageToken` to the `nextPageToken` returned by a +// previous list request to get the next page of results. +func (c *RegionSslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *RegionSslPoliciesListAvailableFeaturesCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter +// "returnPartialSuccess": Opt-in for partial success behavior which +// provides partial results in case of failure. The default value is +// false. +func (c *RegionSslPoliciesListAvailableFeaturesCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionSslPoliciesListAvailableFeaturesCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *RegionSslPoliciesListAvailableFeaturesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionSslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *RegionSslPoliciesListAvailableFeaturesCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *RegionSslPoliciesListAvailableFeaturesCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesListAvailableFeaturesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.listAvailableFeatures" call. +// Exactly one of *SslPoliciesListAvailableFeaturesResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionSslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslPoliciesListAvailableFeaturesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all features that can be specified in the SSL policy when using custom profile.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures", + // "httpMethod": "GET", + // "id": "compute.regionSslPolicies.listAvailableFeatures", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "returnPartialSuccess": { + // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures", + // "response": { + // "$ref": "SslPoliciesListAvailableFeaturesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.regionSslPolicies.patch": + +type RegionSslPoliciesPatchCall struct { + s *Service + project string + region string + sslPolicy string + sslpolicy *SslPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Patches the specified SSL policy with the data included in the +// request. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +// - sslPolicy: Name of the SSL policy to update. The name must be 1-63 +// characters long, and comply with RFC1035. +func (r *RegionSslPoliciesService) Patch(project string, region string, sslPolicy string, sslpolicy *SslPolicy) *RegionSslPoliciesPatchCall { + c := &RegionSslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.sslPolicy = sslPolicy + c.sslpolicy = sslpolicy + return c +} + +// RequestId sets the optional parameter "requestId": An optional +// request ID to identify requests. Specify a unique request ID so that +// if you must retry your request, the server will know to ignore the +// request if it has already been completed. For example, consider a +// situation where you make an initial request and the request times +// out. If you make the request again with the same request ID, the +// server can check if original operation with the same request ID was +// received, and if so, will ignore the second request. This prevents +// clients from accidentally creating duplicate commitments. The request +// ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionSslPoliciesPatchCall) RequestId(requestId string) *RegionSslPoliciesPatchCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesPatchCall) Fields(s ...googleapi.Field) *RegionSslPoliciesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesPatchCall) Context(ctx context.Context) *RegionSslPoliciesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "sslPolicy": c.sslPolicy, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionSslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Patches the specified SSL policy with the data included in the request.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + // "httpMethod": "PATCH", + // "id": "compute.regionSslPolicies.patch", + // "parameterOrder": [ + // "project", + // "region", + // "sslPolicy" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "Name of the region scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + // "location": "query", + // "type": "string" + // }, + // "sslPolicy": { + // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}", + // "request": { + // "$ref": "SslPolicy" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.regionSslPolicies.testIamPermissions": + +type RegionSslPoliciesTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +// +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionSslPoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionSslPoliciesTestIamPermissionsCall { + c := &RegionSslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionSslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionSslPoliciesTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionSslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *RegionSslPoliciesTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *RegionSslPoliciesTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{resource}/testIamPermissions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSslPolicies.testIamPermissions" call. +// Exactly one of *TestPermissionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionSslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{resource}/testIamPermissions", + // "httpMethod": "POST", + // "id": "compute.regionSslPolicies.testIamPermissions", + // "parameterOrder": [ + // "project", + // "region", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name or id of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/regions/{region}/sslPolicies/{resource}/testIamPermissions", + // "request": { + // "$ref": "TestPermissionsRequest" + // }, + // "response": { + // "$ref": "TestPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + // method id "compute.regionTargetHttpProxies.delete": type RegionTargetHttpProxiesDeleteCall struct { @@ -179408,6 +181226,291 @@ func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) } +// method id "compute.sslPolicies.aggregatedList": + +type SslPoliciesAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// AggregatedList: Retrieves the list of all SslPolicy resources, +// regional and global, available to the specified project. +// +// - project: Name of the project scoping this request. +func (r *SslPoliciesService) AggregatedList(project string) *SslPoliciesAggregatedListCall { + c := &SslPoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. The expression must specify +// the field name, an operator, and the value that you want to use for +// filtering. The value must be a string, a number, or a boolean. The +// operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For +// example, if you are filtering Compute Engine instances, you can +// exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:` operator can be used with string fields to +// match substrings. For non-string fields it is equivalent to the `=` +// operator. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label +// use: ``` labels.owner:* ``` You can also filter nested fields. For +// example, you could specify `scheduling.automaticRestart = false` to +// include instances only if they are not scheduled for automatic +// restarts. You can use filtering on nested fields to filter based on +// resource labels. To filter on multiple expressions, provide each +// separate expression within parentheses. For example: ``` +// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") +// ``` By default, each expression is an `AND` expression. However, you +// can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") +// AND (scheduling.automaticRestart = true) ``` +func (c *SslPoliciesAggregatedListCall) Filter(filter string) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// IncludeAllScopes sets the optional parameter "includeAllScopes": +// Indicates whether every visible scope for each scope type (zone, +// region, global) should be included in the response. For new resource +// types added after this field, the flag has no effect as new resource +// types will always include every visible scope for each scope type in +// response. For resource types which predate this field, if this flag +// is omitted or false, only scopes of the scope types where the +// resource type is expected to be found will be included. +func (c *SslPoliciesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of results per page that should be returned. If the number of +// available results is larger than `maxResults`, Compute Engine returns +// a `nextPageToken` that can be used to get the next page of results in +// subsequent list requests. Acceptable values are `0` to `500`, +// inclusive. (Default: `500`) +func (c *SslPoliciesAggregatedListCall) MaxResults(maxResults int64) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. You can also sort results in +// descending order based on the creation timestamp using +// `orderBy="creationTimestamp desc". This sorts results based on the +// `creationTimestamp` field in reverse chronological order (newest +// result first). Use this to sort resources like operations so that the +// newest operation is returned first. Currently, only sorting by `name` +// or `creationTimestamp desc` is supported. +func (c *SslPoliciesAggregatedListCall) OrderBy(orderBy string) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Set `pageToken` to the `nextPageToken` returned by a +// previous list request to get the next page of results. +func (c *SslPoliciesAggregatedListCall) PageToken(pageToken string) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter +// "returnPartialSuccess": Opt-in for partial success behavior which +// provides partial results in case of failure. The default value is +// false. +func (c *SslPoliciesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslPoliciesAggregatedListCall) Fields(s ...googleapi.Field) *SslPoliciesAggregatedListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslPoliciesAggregatedListCall) IfNoneMatch(entityTag string) *SslPoliciesAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SslPoliciesAggregatedListCall) Context(ctx context.Context) *SslPoliciesAggregatedListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *SslPoliciesAggregatedListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *SslPoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/sslPolicies") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.sslPolicies.aggregatedList" call. +// Exactly one of *SslPoliciesAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SslPoliciesAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslPoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesAggregatedList, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslPoliciesAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of all SslPolicy resources, regional and global, available to the specified project.", + // "flatPath": "projects/{project}/aggregated/sslPolicies", + // "httpMethod": "GET", + // "id": "compute.sslPolicies.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", + // "location": "query", + // "type": "string" + // }, + // "includeAllScopes": { + // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "default": "500", + // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "returnPartialSuccess": { + // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "projects/{project}/aggregated/sslPolicies", + // "response": { + // "$ref": "SslPoliciesAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *SslPoliciesAggregatedListCall) Pages(ctx context.Context, f func(*SslPoliciesAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + // method id "compute.sslPolicies.delete": type SslPoliciesDeleteCall struct { diff --git a/content/v2.1/content-api.json b/content/v2.1/content-api.json index e57a71ea2bd..ac3326c53c9 100644 --- a/content/v2.1/content-api.json +++ b/content/v2.1/content-api.json @@ -5986,7 +5986,7 @@ } } }, - "revision": "20220428", + "revision": "20220510", "rootUrl": "https://shoppingcontent.googleapis.com/", "schemas": { "Account": { @@ -6100,7 +6100,7 @@ "type": "string" }, "streetAddress": { - "description": "Street-level part of the address.", + "description": "Street-level part of the address. Use `\\n` to add a second line.", "type": "string" } }, @@ -6145,7 +6145,7 @@ "properties": { "address": { "$ref": "AccountAddress", - "description": "The address of the business." + "description": "The address of the business. Use `\\n` to add a second address line." }, "customerService": { "$ref": "AccountCustomerService", @@ -6654,6 +6654,10 @@ "paymentsManager": { "description": "Whether user can manage payment settings.", "type": "boolean" + }, + "reportingManager": { + "description": "Whether user is a reporting manager.", + "type": "boolean" } }, "type": "object" @@ -7173,7 +7177,7 @@ "type": "string" }, "streetAddress": { - "description": "Street-level part of the address.", + "description": "Street-level part of the address. Use `\\n` to add a second line.", "type": "string" } }, @@ -9848,7 +9852,7 @@ "type": "string" }, "streetAddress": { - "description": "Street-level part of the address.", + "description": "Street-level part of the address. Use `\\n` to add a second line.", "items": { "type": "string" }, @@ -16111,7 +16115,7 @@ "type": "string" }, "streetAddress": { - "description": "Street-level part of the address.", + "description": "Street-level part of the address. Use `\\n` to add a second line.", "items": { "type": "string" }, diff --git a/content/v2.1/content-gen.go b/content/v2.1/content-gen.go index d2e7a7006ee..f131eeea0f7 100644 --- a/content/v2.1/content-gen.go +++ b/content/v2.1/content-gen.go @@ -753,7 +753,8 @@ type AccountAddress struct { // ("QC"). Region string `json:"region,omitempty"` - // StreetAddress: Street-level part of the address. + // StreetAddress: Street-level part of the address. Use `\n` to add a + // second line. StreetAddress string `json:"streetAddress,omitempty"` // ForceSendFields is a list of field names (e.g. "Country") to @@ -880,7 +881,8 @@ func (s *AccountAutomaticImprovements) MarshalJSON() ([]byte, error) { } type AccountBusinessInformation struct { - // Address: The address of the business. + // Address: The address of the business. Use `\n` to add a second + // address line. Address *AccountAddress `json:"address,omitempty"` // CustomerService: The customer service information of the business. @@ -1745,6 +1747,9 @@ type AccountUser struct { // PaymentsManager: Whether user can manage payment settings. PaymentsManager bool `json:"paymentsManager,omitempty"` + // ReportingManager: Whether user is a reporting manager. + ReportingManager bool `json:"reportingManager,omitempty"` + // ForceSendFields is a list of field names (e.g. "Admin") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -2690,7 +2695,8 @@ type Address struct { // PostalCode: Required. Postal code or ZIP (for example, "94043"). PostalCode string `json:"postalCode,omitempty"` - // StreetAddress: Street-level part of the address. + // StreetAddress: Street-level part of the address. Use `\n` to add a + // second line. StreetAddress string `json:"streetAddress,omitempty"` // ForceSendFields is a list of field names (e.g. "AdministrativeArea") @@ -7180,7 +7186,8 @@ type OrderAddress struct { // ("QC"). Region string `json:"region,omitempty"` - // StreetAddress: Street-level part of the address. + // StreetAddress: Street-level part of the address. Use `\n` to add a + // second line. StreetAddress []string `json:"streetAddress,omitempty"` // ForceSendFields is a list of field names (e.g. "Country") to @@ -17550,7 +17557,8 @@ type TestOrderAddress struct { // ("QC"). Region string `json:"region,omitempty"` - // StreetAddress: Street-level part of the address. + // StreetAddress: Street-level part of the address. Use `\n` to add a + // second line. StreetAddress []string `json:"streetAddress,omitempty"` // ForceSendFields is a list of field names (e.g. "Country") to diff --git a/dlp/v2/dlp-api.json b/dlp/v2/dlp-api.json index 2a08ca54504..d668e333df0 100644 --- a/dlp/v2/dlp-api.json +++ b/dlp/v2/dlp-api.json @@ -3412,7 +3412,7 @@ } } }, - "revision": "20220402", + "revision": "20220506", "rootUrl": "https://dlp.googleapis.com/", "schemas": { "GooglePrivacyDlpV2Action": { @@ -5503,6 +5503,11 @@ "description": "The infoType details for this column.", "id": "GooglePrivacyDlpV2InfoTypeSummary", "properties": { + "estimatedPrevalence": { + "description": "Approximate percentage of non-null rows that contained data detected by this infotype.", + "format": "int32", + "type": "integer" + }, "infoType": { "$ref": "GooglePrivacyDlpV2InfoType", "description": "The infoType." @@ -6446,6 +6451,11 @@ "description": "Infotype details for other infoTypes found within a column.", "id": "GooglePrivacyDlpV2OtherInfoTypeSummary", "properties": { + "estimatedPrevalence": { + "description": "Approximate percentage of non-null rows that contained data detected by this infotype.", + "format": "int32", + "type": "integer" + }, "infoType": { "$ref": "GooglePrivacyDlpV2InfoType", "description": "The other infoType." diff --git a/dlp/v2/dlp-gen.go b/dlp/v2/dlp-gen.go index 3f074ec757b..47e2600368c 100644 --- a/dlp/v2/dlp-gen.go +++ b/dlp/v2/dlp-gen.go @@ -4333,23 +4333,28 @@ func (s *GooglePrivacyDlpV2InfoTypeStats) MarshalJSON() ([]byte, error) { // GooglePrivacyDlpV2InfoTypeSummary: The infoType details for this // column. type GooglePrivacyDlpV2InfoTypeSummary struct { + // EstimatedPrevalence: Approximate percentage of non-null rows that + // contained data detected by this infotype. + EstimatedPrevalence int64 `json:"estimatedPrevalence,omitempty"` + // InfoType: The infoType. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"` - // ForceSendFields is a list of field names (e.g. "InfoType") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "EstimatedPrevalence") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "InfoType") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "EstimatedPrevalence") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } @@ -6007,23 +6012,28 @@ func (s *GooglePrivacyDlpV2NumericalStatsResult) MarshalJSON() ([]byte, error) { // GooglePrivacyDlpV2OtherInfoTypeSummary: Infotype details for other // infoTypes found within a column. type GooglePrivacyDlpV2OtherInfoTypeSummary struct { + // EstimatedPrevalence: Approximate percentage of non-null rows that + // contained data detected by this infotype. + EstimatedPrevalence int64 `json:"estimatedPrevalence,omitempty"` + // InfoType: The other infoType. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"` - // ForceSendFields is a list of field names (e.g. "InfoType") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "EstimatedPrevalence") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "InfoType") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "EstimatedPrevalence") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } diff --git a/drive/v2/drive-api.json b/drive/v2/drive-api.json index 653ac70fb79..665fba0e2b7 100644 --- a/drive/v2/drive-api.json +++ b/drive/v2/drive-api.json @@ -38,7 +38,7 @@ "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "discoveryVersion": "v1", "documentationLink": "https://developers.google.com/drive/", - "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/EpcsQ8zN5Q6e-3DdG1WPwSIcAkA\"", + "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/FJ_l9FpOo0745yxBh-UGhApXY3k\"", "icons": { "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" @@ -3539,7 +3539,7 @@ } } }, - "revision": "20220417", + "revision": "20220508", "rootUrl": "https://www.googleapis.com/", "schemas": { "About": { @@ -4531,6 +4531,10 @@ "description": "Whether the current user can rename this shared drive.", "type": "boolean" }, + "canResetDriveRestrictions": { + "description": "Whether the current user can reset the shared drive restrictions to defaults.", + "type": "boolean" + }, "canShare": { "description": "Whether the current user can share files or folders in this shared drive.", "type": "boolean" @@ -5939,6 +5943,10 @@ "description": "Whether the current user can rename this Team Drive.", "type": "boolean" }, + "canResetTeamDriveRestrictions": { + "description": "Whether the current user can reset the Team Drive restrictions to defaults.", + "type": "boolean" + }, "canShare": { "description": "Whether the current user can share files or folders in this Team Drive.", "type": "boolean" diff --git a/drive/v2/drive-gen.go b/drive/v2/drive-gen.go index d3c0367dd1f..b5b89bd3397 100644 --- a/drive/v2/drive-gen.go +++ b/drive/v2/drive-gen.go @@ -1813,6 +1813,10 @@ type DriveCapabilities struct { // drive. CanRenameDrive bool `json:"canRenameDrive,omitempty"` + // CanResetDriveRestrictions: Whether the current user can reset the + // shared drive restrictions to defaults. + CanResetDriveRestrictions bool `json:"canResetDriveRestrictions,omitempty"` + // CanShare: Whether the current user can share files or folders in this // shared drive. CanShare bool `json:"canShare,omitempty"` @@ -3841,6 +3845,10 @@ type TeamDriveCapabilities struct { // Drive. CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"` + // CanResetTeamDriveRestrictions: Whether the current user can reset the + // Team Drive restrictions to defaults. + CanResetTeamDriveRestrictions bool `json:"canResetTeamDriveRestrictions,omitempty"` + // CanShare: Whether the current user can share files or folders in this // Team Drive. CanShare bool `json:"canShare,omitempty"` diff --git a/drive/v3/drive-api.json b/drive/v3/drive-api.json index 8d4d3fcfc44..5c0ab76fdca 100644 --- a/drive/v3/drive-api.json +++ b/drive/v3/drive-api.json @@ -35,7 +35,7 @@ "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "discoveryVersion": "v1", "documentationLink": "https://developers.google.com/drive/", - "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/LI5k5ZxpZiLSJAmBbdB9dlf2J48\"", + "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/DjxGwbwcG0aMN4JG40B35nyJYNc\"", "icons": { "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" @@ -2203,7 +2203,7 @@ } } }, - "revision": "20220417", + "revision": "20220508", "rootUrl": "https://www.googleapis.com/", "schemas": { "About": { @@ -2703,6 +2703,10 @@ "description": "Whether the current user can rename this shared drive.", "type": "boolean" }, + "canResetDriveRestrictions": { + "description": "Whether the current user can reset the shared drive restrictions to defaults.", + "type": "boolean" + }, "canShare": { "description": "Whether the current user can share files or folders in this shared drive.", "type": "boolean" @@ -3887,6 +3891,10 @@ "description": "Whether the current user can rename this Team Drive.", "type": "boolean" }, + "canResetTeamDriveRestrictions": { + "description": "Whether the current user can reset the Team Drive restrictions to defaults.", + "type": "boolean" + }, "canShare": { "description": "Whether the current user can share files or folders in this Team Drive.", "type": "boolean" diff --git a/drive/v3/drive-gen.go b/drive/v3/drive-gen.go index 3eb3088bdd6..15efd7008af 100644 --- a/drive/v3/drive-gen.go +++ b/drive/v3/drive-gen.go @@ -1076,6 +1076,10 @@ type DriveCapabilities struct { // drive. CanRenameDrive bool `json:"canRenameDrive,omitempty"` + // CanResetDriveRestrictions: Whether the current user can reset the + // shared drive restrictions to defaults. + CanResetDriveRestrictions bool `json:"canResetDriveRestrictions,omitempty"` + // CanShare: Whether the current user can share files or folders in this // shared drive. CanShare bool `json:"canShare,omitempty"` @@ -2865,6 +2869,10 @@ type TeamDriveCapabilities struct { // Drive. CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"` + // CanResetTeamDriveRestrictions: Whether the current user can reset the + // Team Drive restrictions to defaults. + CanResetTeamDriveRestrictions bool `json:"canResetTeamDriveRestrictions,omitempty"` + // CanShare: Whether the current user can share files or folders in this // Team Drive. CanShare bool `json:"canShare,omitempty"` diff --git a/healthcare/v1/healthcare-api.json b/healthcare/v1/healthcare-api.json index 5b81196894c..d329c6bfcf9 100644 --- a/healthcare/v1/healthcare-api.json +++ b/healthcare/v1/healthcare-api.json @@ -3017,7 +3017,7 @@ "type": "string" }, "profile": { - "description": "A profile that this resource should be validated against.", + "description": "The canonical URL of a profile that this resource should be validated against. For example, to validate a Patient resource against the US Core Patient profile this parameter would be `http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient`. A StructureDefinition with this canonical URL must exist in the FHIR store.", "location": "query", "type": "string" }, @@ -4053,7 +4053,7 @@ } } }, - "revision": "20220413", + "revision": "20220428", "rootUrl": "https://healthcare.googleapis.com/", "schemas": { "ActivateConsentRequest": { @@ -4211,7 +4211,7 @@ "type": "object" }, "AuditConfig": { - "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.", + "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", "id": "AuditConfig", "properties": { "auditLogConfigs": { diff --git a/healthcare/v1/healthcare-gen.go b/healthcare/v1/healthcare-gen.go index 490f4684a13..681d0f361a0 100644 --- a/healthcare/v1/healthcare-gen.go +++ b/healthcare/v1/healthcare-gen.go @@ -642,8 +642,8 @@ func (s *AttributeDefinition) MarshalJSON() ([]byte, error) { // "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ // "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy // enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts -// jose@example.com from DATA_READ logging, and aliya@example.com from -// DATA_WRITE logging. +// `jose@example.com` from DATA_READ logging, and `aliya@example.com` +// from DATA_WRITE logging. type AuditConfig struct { // AuditLogConfigs: The configuration for logging of each type of // permission. @@ -20179,8 +20179,13 @@ func (r *ProjectsLocationsDatasetsFhirStoresFhirService) ResourceValidate(parent return c } -// Profile sets the optional parameter "profile": A profile that this -// resource should be validated against. +// Profile sets the optional parameter "profile": The canonical URL of a +// profile that this resource should be validated against. For example, +// to validate a Patient resource against the US Core Patient profile +// this parameter would be +// `http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient`. A +// StructureDefinition with this canonical URL must exist in the FHIR +// store. func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) Profile(profile string) *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall { c.urlParams_.Set("profile", profile) return c @@ -20256,7 +20261,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) Do(opts .. // "type": "string" // }, // "profile": { - // "description": "A profile that this resource should be validated against.", + // "description": "The canonical URL of a profile that this resource should be validated against. For example, to validate a Patient resource against the US Core Patient profile this parameter would be `http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient`. A StructureDefinition with this canonical URL must exist in the FHIR store.", // "location": "query", // "type": "string" // }, diff --git a/healthcare/v1beta1/healthcare-api.json b/healthcare/v1beta1/healthcare-api.json index 4618e658dc8..6b05e0867d9 100644 --- a/healthcare/v1beta1/healthcare-api.json +++ b/healthcare/v1beta1/healthcare-api.json @@ -3672,7 +3672,7 @@ "type": "string" }, "profile": { - "description": "A profile that this resource should be validated against.", + "description": "The canonical URL of a profile that this resource should be validated against. For example, to validate a Patient resource against the US Core Patient profile this parameter would be `http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient`. A StructureDefinition with this canonical URL must exist in the FHIR store.", "location": "query", "type": "string" }, @@ -4865,7 +4865,7 @@ } } }, - "revision": "20220413", + "revision": "20220428", "rootUrl": "https://healthcare.googleapis.com/", "schemas": { "ActivateConsentRequest": { @@ -5101,7 +5101,7 @@ "type": "object" }, "AuditConfig": { - "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.", + "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", "id": "AuditConfig", "properties": { "auditLogConfigs": { diff --git a/healthcare/v1beta1/healthcare-gen.go b/healthcare/v1beta1/healthcare-gen.go index fda16bb921f..41a8ed8a8c8 100644 --- a/healthcare/v1beta1/healthcare-gen.go +++ b/healthcare/v1beta1/healthcare-gen.go @@ -837,8 +837,8 @@ func (s *AttributeDefinition) MarshalJSON() ([]byte, error) { // "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ // "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy // enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts -// jose@example.com from DATA_READ logging, and aliya@example.com from -// DATA_WRITE logging. +// `jose@example.com` from DATA_READ logging, and `aliya@example.com` +// from DATA_WRITE logging. type AuditConfig struct { // AuditLogConfigs: The configuration for logging of each type of // permission. @@ -24704,8 +24704,13 @@ func (r *ProjectsLocationsDatasetsFhirStoresFhirService) ResourceValidate(parent return c } -// Profile sets the optional parameter "profile": A profile that this -// resource should be validated against. +// Profile sets the optional parameter "profile": The canonical URL of a +// profile that this resource should be validated against. For example, +// to validate a Patient resource against the US Core Patient profile +// this parameter would be +// `http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient`. A +// StructureDefinition with this canonical URL must exist in the FHIR +// store. func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) Profile(profile string) *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall { c.urlParams_.Set("profile", profile) return c @@ -24781,7 +24786,7 @@ func (c *ProjectsLocationsDatasetsFhirStoresFhirResourceValidateCall) Do(opts .. // "type": "string" // }, // "profile": { - // "description": "A profile that this resource should be validated against.", + // "description": "The canonical URL of a profile that this resource should be validated against. For example, to validate a Patient resource against the US Core Patient profile this parameter would be `http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient`. A StructureDefinition with this canonical URL must exist in the FHIR store.", // "location": "query", // "type": "string" // }, diff --git a/iam/v1/iam-api.json b/iam/v1/iam-api.json index 28f872159c7..8d88f26aa31 100644 --- a/iam/v1/iam-api.json +++ b/iam/v1/iam-api.json @@ -1348,7 +1348,7 @@ "type": "integer" }, "resource": { - "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", "required": true, @@ -1437,7 +1437,7 @@ ], "parameters": { "resource": { - "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", "required": true, @@ -1521,7 +1521,7 @@ ], "parameters": { "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", "required": true, @@ -1921,7 +1921,7 @@ } } }, - "revision": "20220428", + "revision": "20220509", "rootUrl": "https://iam.googleapis.com/", "schemas": { "AdminAuditData": { diff --git a/iam/v1/iam-gen.go b/iam/v1/iam-gen.go index bc5defcc793..06f5f6d60b9 100644 --- a/iam/v1/iam-gen.go +++ b/iam/v1/iam-gen.go @@ -9171,8 +9171,9 @@ type ProjectsServiceAccountsGetIamPolicyCall struct { // method. // // - resource: REQUIRED: The resource for which the policy is being -// requested. See the operation documentation for the appropriate -// value for this field. +// requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. func (r *ProjectsServiceAccountsService) GetIamPolicy(resource string) *ProjectsServiceAccountsGetIamPolicyCall { c := &ProjectsServiceAccountsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -9298,7 +9299,7 @@ func (c *ProjectsServiceAccountsGetIamPolicyCall) Do(opts ...googleapi.CallOptio // "type": "integer" // }, // "resource": { - // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", // "required": true, @@ -9693,8 +9694,9 @@ type ProjectsServiceAccountsSetIamPolicyCall struct { // (https://cloud.google.com/iam/help/access/manage-other-resources). // // - resource: REQUIRED: The resource for which the policy is being -// specified. See the operation documentation for the appropriate -// value for this field. +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. func (r *ProjectsServiceAccountsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsServiceAccountsSetIamPolicyCall { c := &ProjectsServiceAccountsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -9802,7 +9804,7 @@ func (c *ProjectsServiceAccountsSetIamPolicyCall) Do(opts ...googleapi.CallOptio // ], // "parameters": { // "resource": { - // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", // "required": true, @@ -10146,7 +10148,8 @@ type ProjectsServiceAccountsTestIamPermissionsCall struct { // permissions on a ServiceAccount. // // - resource: REQUIRED: The resource for which the policy detail is -// being requested. See the operation documentation for the +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the // appropriate value for this field. func (r *ProjectsServiceAccountsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsServiceAccountsTestIamPermissionsCall { c := &ProjectsServiceAccountsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -10255,7 +10258,7 @@ func (c *ProjectsServiceAccountsTestIamPermissionsCall) Do(opts ...googleapi.Cal // ], // "parameters": { // "resource": { - // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", // "required": true, diff --git a/redis/v1/redis-api.json b/redis/v1/redis-api.json index 5a9c979a942..e631b1e1d8d 100644 --- a/redis/v1/redis-api.json +++ b/redis/v1/redis-api.json @@ -624,7 +624,7 @@ } } }, - "revision": "20220331", + "revision": "20220503", "rootUrl": "https://redis.googleapis.com/", "schemas": { "Empty": { @@ -837,6 +837,10 @@ "description": "Output only. Date and time of upcoming maintenance events which have been scheduled.", "readOnly": true }, + "maintenanceVersion": { + "description": "Optional. The self service update maintenance version. The version is date based such as \"20210712_00_00\".", + "type": "string" + }, "memorySizeGb": { "description": "Required. Redis memory size in GiB.", "format": "int32", diff --git a/redis/v1/redis-gen.go b/redis/v1/redis-gen.go index e940f98b041..de203574146 100644 --- a/redis/v1/redis-gen.go +++ b/redis/v1/redis-gen.go @@ -537,6 +537,10 @@ type Instance struct { // maintenance events which have been scheduled. MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"` + // MaintenanceVersion: Optional. The self service update maintenance + // version. The version is date based such as "20210712_00_00". + MaintenanceVersion string `json:"maintenanceVersion,omitempty"` + // MemorySizeGb: Required. Redis memory size in GiB. MemorySizeGb int64 `json:"memorySizeGb,omitempty"` diff --git a/redis/v1beta1/redis-api.json b/redis/v1beta1/redis-api.json index ef997652f5e..46560ce5e8c 100644 --- a/redis/v1beta1/redis-api.json +++ b/redis/v1beta1/redis-api.json @@ -624,7 +624,7 @@ } } }, - "revision": "20220331", + "revision": "20220503", "rootUrl": "https://redis.googleapis.com/", "schemas": { "Empty": { @@ -844,6 +844,10 @@ "description": "Output only. Date and time of upcoming maintenance events which have been scheduled.", "readOnly": true }, + "maintenanceVersion": { + "description": "Optional. The self service update maintenance version. The version is date based such as \"20210712_00_00\".", + "type": "string" + }, "memorySizeGb": { "description": "Required. Redis memory size in GiB.", "format": "int32", diff --git a/redis/v1beta1/redis-gen.go b/redis/v1beta1/redis-gen.go index 7520ff9562a..e84578f4bf8 100644 --- a/redis/v1beta1/redis-gen.go +++ b/redis/v1beta1/redis-gen.go @@ -542,6 +542,10 @@ type Instance struct { // maintenance events which have been scheduled. MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"` + // MaintenanceVersion: Optional. The self service update maintenance + // version. The version is date based such as "20210712_00_00". + MaintenanceVersion string `json:"maintenanceVersion,omitempty"` + // MemorySizeGb: Required. Redis memory size in GiB. MemorySizeGb int64 `json:"memorySizeGb,omitempty"` diff --git a/retail/v2/retail-api.json b/retail/v2/retail-api.json index 0dbc7612123..233f77e5d29 100644 --- a/retail/v2/retail-api.json +++ b/retail/v2/retail-api.json @@ -636,7 +636,7 @@ ] }, "setInventory": { - "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -1133,7 +1133,7 @@ } } }, - "revision": "20220430", + "revision": "20220505", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1287,13 +1287,13 @@ "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesRequest": { - "description": "Request message for AddFulfillmentPlaces method.", + "description": "Request message for ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesRequest", "properties": { "addTime": { @@ -1320,19 +1320,19 @@ "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesRequest": { - "description": "Request message for AddLocalInventories method.", + "description": "Request message for ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesRequest", "properties": { "addMask": { @@ -1360,7 +1360,7 @@ "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -1547,7 +1547,7 @@ "id": "GoogleCloudRetailV2CustomAttribute", "properties": { "indexable": { - "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more on [configuration mode] (https://cloud.google.com/retail/docs/attribute-config#config-modes). if true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.", + "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are indexed, so that they can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.", "type": "boolean" }, "numbers": { @@ -1559,7 +1559,7 @@ "type": "array" }, "searchable": { - "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more on [configuration mode] (https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.", + "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.", "type": "boolean" }, "text": { @@ -1925,7 +1925,7 @@ "additionalProperties": { "type": "string" }, - "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", "type": "object" }, "pageSize": { @@ -1996,7 +1996,7 @@ "additionalProperties": { "type": "any" }, - "description": "Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Will be set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Will be set if `returnScore` is set to true in `PredictRequest.params`.", + "description": "Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Is set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Is set if `returnScore` is set to true in `PredictRequest.params`.", "type": "object" } }, @@ -2211,7 +2211,7 @@ "description": "The rating of this product." }, "retrievableFields": { - "description": "Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form \"attributes.key\" where \"key\" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse may increase response payload size and serving latency.", + "description": "Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form \"attributes.key\" where \"key\" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.", "format": "google-fieldmask", "type": "string" }, @@ -2551,7 +2551,7 @@ "properties": { "boostSpec": { "$ref": "GoogleCloudRetailV2SearchRequestBoostSpec", - "description": "Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions." + "description": "Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions." }, "branch": { "description": "The branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use \"default_branch\" as the branch ID or leave this field empty, to search products under the default branch.", @@ -2580,7 +2580,7 @@ "additionalProperties": { "type": "string" }, - "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", "type": "object" }, "offset": { @@ -2630,16 +2630,20 @@ "enumDescriptions": [ "Default value. In this case both product search and faceted search will be performed. Both [SearchResponse.SearchResult] and [SearchResponse.Facet] will be returned.", "Only product search will be performed. The faceted search will be disabled. Only [SearchResponse.SearchResult] will be returned. [SearchResponse.Facet] will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", - "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_spec and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." + "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." ], "type": "string" }, + "spellCorrectionSpec": { + "$ref": "GoogleCloudRetailV2SearchRequestSpellCorrectionSpec", + "description": "The spell correction specification that specifies the mode under which spell correction will take effect." + }, "userInfo": { "$ref": "GoogleCloudRetailV2UserInfo", "description": "User information." }, "variantRollupKeys": { - "description": "The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of \"fulfillmentType.fulfillmentId\". E.g., in \"pickupInStore.store123\", \"pickupInStore\" is fulfillment type and \"store123\" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"pickup-in-store\". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"ship-to-store\". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"same-day-delivery\". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"next-day-delivery\". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-1\". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-2\". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-3\". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-4\". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-5\". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.", + "description": "The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of \"fulfillmentType.fulfillmentId\". E.g., in \"pickupInStore.store123\", \"pickupInStore\" is fulfillment type and \"store123\" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.local_inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"pickup-in-store\". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"ship-to-store\". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"same-day-delivery\". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"next-day-delivery\". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-1\". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-2\". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-3\". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-4\". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-5\". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.", "items": { "type": "string" }, @@ -2827,6 +2831,27 @@ }, "type": "object" }, + "GoogleCloudRetailV2SearchRequestSpellCorrectionSpec": { + "description": "The specification for query spell correction.", + "id": "GoogleCloudRetailV2SearchRequestSpellCorrectionSpec", + "properties": { + "mode": { + "description": "The mode under which spell correction should take effect to replace the original search query. Default to Mode.AUTO.", + "enum": [ + "MODE_UNSPECIFIED", + "SUGGESTION_ONLY", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified spell correction mode. This defaults to Mode.AUTO.", + "Google Retail Search will try to find a spell suggestion if there is any and put in the SearchResponse.corrected_query. The spell suggestion will not be used as the search query.", + "Automatic spell correction built by Google Retail Search. Search will be based on the corrected query if found." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2SearchResponse": { "description": "Response message for SearchService.Search method.", "id": "GoogleCloudRetailV2SearchResponse", @@ -2843,7 +2868,7 @@ "type": "string" }, "correctedQuery": { - "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results will be based on corrected_query, otherwise the original query will be used for search.", + "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query will be used for search.", "type": "string" }, "facets": { @@ -2869,7 +2894,7 @@ "description": "Query expansion information for the returned results." }, "redirectUri": { - "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search will be performed, and only redirect_uri and attribution_token will be set in the response.", + "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.", "type": "string" }, "results": { @@ -3211,25 +3236,25 @@ "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -3275,7 +3300,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2alphaExportErrorsConfig", - "description": "Echoes the destination for the complete errors in the request if set." + "description": "This field is never set." } }, "type": "object" @@ -3293,7 +3318,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2alphaExportErrorsConfig", - "description": "Echoes the destination for the complete errors if this field was set in the request." + "description": "This field is never set." } }, "type": "object" @@ -3534,25 +3559,25 @@ "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -3598,7 +3623,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2betaExportErrorsConfig", - "description": "Echoes the destination for the complete errors in the request if set." + "description": "This field is never set." } }, "type": "object" @@ -3616,7 +3641,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2betaExportErrorsConfig", - "description": "Echoes the destination for the complete errors if this field was set in the request." + "description": "This field is never set." } }, "type": "object" diff --git a/retail/v2/retail-gen.go b/retail/v2/retail-gen.go index b17b79f9ae4..713db1f63e9 100644 --- a/retail/v2/retail-gen.go +++ b/retail/v2/retail-gen.go @@ -573,12 +573,12 @@ func (s *GoogleCloudRetailLoggingSourceLocation) MarshalJSON() ([]byte, error) { // GoogleCloudRetailV2AddFulfillmentPlacesMetadata: Metadata related to // the progress of the AddFulfillmentPlaces operation. Currently empty // because there is no meaningful metadata populated from the -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2AddFulfillmentPlacesRequest: Request message for -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesRequest struct { // AddTime: The time when the fulfillment updates are issued, used to // prevent out-of-order updates on fulfillment information. If not @@ -637,19 +637,20 @@ func (s *GoogleCloudRetailV2AddFulfillmentPlacesRequest) MarshalJSON() ([]byte, // GoogleCloudRetailV2AddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2AddLocalInventoriesMetadata: Metadata related to // the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2AddLocalInventoriesRequest: Request message for -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesRequest struct { // AddMask: Indicates which inventory fields in the provided list of // LocalInventory to update. The field is updated to the provided value. @@ -702,8 +703,9 @@ func (s *GoogleCloudRetailV2AddLocalInventoriesRequest) MarshalJSON() ([]byte, e } // GoogleCloudRetailV2AddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesResponse struct { } @@ -1111,10 +1113,10 @@ func (s *GoogleCloudRetailV2CompletionDetail) MarshalJSON() ([]byte, error) { type GoogleCloudRetailV2CustomAttribute struct { // Indexable: This field is normally ignored unless // AttributesConfig.attribute_config_level of the Catalog is set to the - // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more - // on [configuration mode] + // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information + // about product-level attribute configuration, see Configuration modes // (https://cloud.google.com/retail/docs/attribute-config#config-modes). - // if true, custom attribute values are indexed, so that it can be + // If true, custom attribute values are indexed, so that they can be // filtered, faceted or boosted in SearchService.Search. This field is // ignored in a UserEvent. See SearchRequest.filter, // SearchRequest.facet_specs and SearchRequest.boost_spec for more @@ -1129,8 +1131,8 @@ type GoogleCloudRetailV2CustomAttribute struct { // Searchable: This field is normally ignored unless // AttributesConfig.attribute_config_level of the Catalog is set to the - // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more - // on [configuration mode] + // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information + // about product-level attribute configuration, see Configuration modes // (https://cloud.google.com/retail/docs/attribute-config#config-modes). // If true, custom attribute values are searchable by text queries in // SearchService.Search. This field is ignored in a UserEvent. Only set @@ -1897,14 +1899,14 @@ type GoogleCloudRetailV2PredictRequest struct { // Labels: The labels applied to a resource must meet the following // requirements: * Each resource can have multiple labels, up to a // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters, - // and cannot be empty. Values can be empty, and have a maximum length - // of 63 characters. * Keys and values can contain only lowercase - // letters, numeric characters, underscores, and dashes. All characters - // must use UTF-8 encoding, and international characters are allowed. * - // The key portion of a label must be unique. However, you can use the - // same key with multiple resources. * Keys must start with a lowercase - // letter or international character. See Google Cloud Document + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) // for more details. Labels map[string]string `json:"labels,omitempty"` @@ -2035,10 +2037,10 @@ type GoogleCloudRetailV2PredictResponsePredictionResult struct { Id string `json:"id,omitempty"` // Metadata: Additional product metadata / annotations. Possible values: - // * `product`: JSON representation of the product. Will be set if + // * `product`: JSON representation of the product. Is set if // `returnProduct` is set to true in `PredictRequest.params`. * `score`: - // Prediction score in double value. Will be set if `returnScore` is set - // to true in `PredictRequest.params`. + // Prediction score in double value. Is set if `returnScore` is set to + // true in `PredictRequest.params`. Metadata googleapi.RawMessage `json:"metadata,omitempty"` // ForceSendFields is a list of field names (e.g. "Id") to @@ -2426,9 +2428,9 @@ type GoogleCloudRetailV2Product struct { // Type.PRIMARY and Type.COLLECTION, the following fields are always // returned in SearchResponse by default: * name For Type.VARIANT, the // following fields are always returned in by default: * name * - // color_info Maximum number of paths is 30. Otherwise, an + // color_info The maximum number of paths is 30. Otherwise, an // INVALID_ARGUMENT error is returned. Note: Returning more fields in - // SearchResponse may increase response payload size and serving + // SearchResponse can increase response payload size and serving // latency. RetrievableFields string `json:"retrievableFields,omitempty"` @@ -3152,8 +3154,8 @@ type GoogleCloudRetailV2SearchRequest struct { // BoostSpec: Boost specification to boost certain products. See more // details at this user guide // (https://cloud.google.com/retail/docs/boosting). Notice that if both - // ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are - // set, the boost conditions from both places are evaluated. If a search + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search // request matches multiple boost conditions, the final boost score is // equal to the sum of the boost scores from all matched boost // conditions. @@ -3199,14 +3201,14 @@ type GoogleCloudRetailV2SearchRequest struct { // Labels: The labels applied to a resource must meet the following // requirements: * Each resource can have multiple labels, up to a // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters, - // and cannot be empty. Values can be empty, and have a maximum length - // of 63 characters. * Keys and values can contain only lowercase - // letters, numeric characters, underscores, and dashes. All characters - // must use UTF-8 encoding, and international characters are allowed. * - // The key portion of a label must be unique. However, you can use the - // same key with multiple resources. * Keys must start with a lowercase - // letter or international character. See Google Cloud Document + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) // for more details. Labels map[string]string `json:"labels,omitempty"` @@ -3280,12 +3282,16 @@ type GoogleCloudRetailV2SearchRequest struct { // set. // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The // product search will be disabled. When in this mode, one or both of - // SearchRequest.facet_spec and SearchRequest.dynamic_facet_spec should + // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only // [SearchResponse.Facet] will be returned. // [SearchResponse.SearchResult] will not be returned. SearchMode string `json:"searchMode,omitempty"` + // SpellCorrectionSpec: The spell correction specification that + // specifies the mode under which spell correction will take effect. + SpellCorrectionSpec *GoogleCloudRetailV2SearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + // UserInfo: User information. UserInfo *GoogleCloudRetailV2UserInfo `json:"userInfo,omitempty"` @@ -3301,9 +3307,9 @@ type GoogleCloudRetailV2SearchRequest struct { // colorFamilies * price * originalPrice * discount * variantId * // inventory(place_id,price) * inventory(place_id,original_price) * // inventory(place_id,attributes.key), where key is any key in the - // Product.inventories.attributes map. * attributes.key, where key is - // any key in the Product.attributes map. * pickupInStore.id, where id - // is any FulfillmentInfo.place_ids for FulfillmentInfo.type + // Product.local_inventories.attributes map. * attributes.key, where key + // is any key in the Product.attributes map. * pickupInStore.id, where + // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type // "pickup-in-store". * shipToStore.id, where id is any // FulfillmentInfo.place_ids for FulfillmentInfo.type "ship-to-store". * // sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for @@ -3735,6 +3741,46 @@ func (s *GoogleCloudRetailV2SearchRequestQueryExpansionSpec) MarshalJSON() ([]by return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2SearchRequestSpellCorrectionSpec: The +// specification for query spell correction. +type GoogleCloudRetailV2SearchRequestSpellCorrectionSpec struct { + // Mode: The mode under which spell correction should take effect to + // replace the original search query. Default to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Unspecified spell correction mode. This + // defaults to Mode.AUTO. + // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell + // suggestion if there is any and put in the + // SearchResponse.corrected_query. The spell suggestion will not be used + // as the search query. + // "AUTO" - Automatic spell correction built by Google Retail Search. + // Search will be based on the corrected query if found. + Mode string `json:"mode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Mode") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudRetailV2SearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2SearchRequestSpellCorrectionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2SearchResponse: Response message for // SearchService.Search method. type GoogleCloudRetailV2SearchResponse struct { @@ -3749,9 +3795,9 @@ type GoogleCloudRetailV2SearchResponse struct { AttributionToken string `json:"attributionToken,omitempty"` // CorrectedQuery: Contains the spell corrected query, if found. If the - // spell correction type is AUTOMATIC, then the search results will be - // based on corrected_query, otherwise the original query will be used - // for search. + // spell correction type is AUTOMATIC, then the search results are based + // on corrected_query. Otherwise the original query will be used for + // search. CorrectedQuery string `json:"correctedQuery,omitempty"` // Facets: Results of facets requested by user. @@ -3772,8 +3818,8 @@ type GoogleCloudRetailV2SearchResponse struct { QueryExpansionInfo *GoogleCloudRetailV2SearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` // RedirectUri: The URI of a customer-defined redirect page. If redirect - // action is triggered, no search will be performed, and only - // redirect_uri and attribution_token will be set in the response. + // action is triggered, no search is performed, and only redirect_uri + // and attribution_token are set in the response. RedirectUri string `json:"redirectUri,omitempty"` // Results: A list of matched items. The order represents the ranking. @@ -4490,26 +4536,28 @@ func (s *GoogleCloudRetailV2UserInfo) MarshalJSON() ([]byte, error) { // GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata // related to the progress of the AddFulfillmentPlaces operation. // Currently empty because there is no meaningful metadata populated -// from the AddFulfillmentPlaces method. +// from the ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related // to the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { } @@ -4589,8 +4637,7 @@ type GoogleCloudRetailV2alphaExportProductsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -4626,8 +4673,7 @@ type GoogleCloudRetailV2alphaExportUserEventsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -5078,26 +5124,28 @@ func (s *GoogleCloudRetailV2alphaUserEventImportSummary) MarshalJSON() ([]byte, // GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related // to the progress of the AddFulfillmentPlaces operation. Currently // empty because there is no meaningful metadata populated from the -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related // to the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { } @@ -5177,8 +5225,7 @@ type GoogleCloudRetailV2betaExportProductsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -5214,8 +5261,7 @@ type GoogleCloudRetailV2betaExportUserEventsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -8531,9 +8577,10 @@ type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { // no inventory fields are set in SetInventoryRequest.set_mask, then any // existing inventory information will be preserved. Pre-existing // inventory information can only be updated with SetInventory, -// AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is -// only available for users who have Retail Search enabled. Please -// enable Retail Search on Cloud Console before using this feature. +// ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. +// This feature is only available for users who have Retail Search +// enabled. Please enable Retail Search on Cloud Console before using +// this feature. // // - name: Immutable. Full resource name of the product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -8636,7 +8683,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } return ret, nil // { - // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.setInventory", diff --git a/retail/v2alpha/retail-api.json b/retail/v2alpha/retail-api.json index 87e33865949..6892409bb6a 100644 --- a/retail/v2alpha/retail-api.json +++ b/retail/v2alpha/retail-api.json @@ -875,7 +875,7 @@ ] }, "setInventory": { - "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -1747,7 +1747,7 @@ } } }, - "revision": "20220430", + "revision": "20220505", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1901,25 +1901,25 @@ "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -2136,13 +2136,13 @@ "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest": { - "description": "Request message for AddFulfillmentPlaces method.", + "description": "Request message for ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest", "properties": { "addTime": { @@ -2169,19 +2169,19 @@ "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesRequest": { - "description": "Request message for AddLocalInventories method.", + "description": "Request message for ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesRequest", "properties": { "addMask": { @@ -2209,7 +2209,7 @@ "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -2341,7 +2341,7 @@ "type": "string" }, "inUse": { - "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using AddCatalogAttribute, ImportCatalogAttributes, or UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes that are not in use by products can be deleted. CatalogAttributes that are in use by products cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", + "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes that are not in use by products can be deleted. CatalogAttributes that are in use by products cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", "readOnly": true, "type": "boolean" }, @@ -2666,7 +2666,7 @@ "id": "GoogleCloudRetailV2alphaCustomAttribute", "properties": { "indexable": { - "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more on [configuration mode] (https://cloud.google.com/retail/docs/attribute-config#config-modes). if true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.", + "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are indexed, so that they can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.", "type": "boolean" }, "numbers": { @@ -2678,7 +2678,7 @@ "type": "array" }, "searchable": { - "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more on [configuration mode] (https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.", + "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.", "type": "boolean" }, "text": { @@ -2732,7 +2732,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2alphaExportErrorsConfig", - "description": "Echoes the destination for the complete errors in the request if set." + "description": "This field is never set." } }, "type": "object" @@ -2750,7 +2750,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2alphaExportErrorsConfig", - "description": "Echoes the destination for the complete errors if this field was set in the request." + "description": "This field is never set." } }, "type": "object" @@ -3198,7 +3198,7 @@ "additionalProperties": { "type": "string" }, - "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", "type": "object" }, "pageSize": { @@ -3269,7 +3269,7 @@ "additionalProperties": { "type": "any" }, - "description": "Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Will be set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Will be set if `returnScore` is set to true in `PredictRequest.params`.", + "description": "Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Is set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Is set if `returnScore` is set to true in `PredictRequest.params`.", "type": "object" } }, @@ -3484,7 +3484,7 @@ "description": "The rating of this product." }, "retrievableFields": { - "description": "Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form \"attributes.key\" where \"key\" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse may increase response payload size and serving latency.", + "description": "Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form \"attributes.key\" where \"key\" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.", "format": "google-fieldmask", "type": "string" }, @@ -4110,7 +4110,7 @@ "properties": { "boostSpec": { "$ref": "GoogleCloudRetailV2alphaSearchRequestBoostSpec", - "description": "Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions." + "description": "Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions." }, "branch": { "description": "The branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use \"default_branch\" as the branch ID or leave this field empty, to search products under the default branch.", @@ -4139,7 +4139,7 @@ "additionalProperties": { "type": "string" }, - "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", "type": "object" }, "offset": { @@ -4207,16 +4207,20 @@ "enumDescriptions": [ "Default value. In this case both product search and faceted search will be performed. Both [SearchResponse.SearchResult] and [SearchResponse.Facet] will be returned.", "Only product search will be performed. The faceted search will be disabled. Only [SearchResponse.SearchResult] will be returned. [SearchResponse.Facet] will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", - "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_spec and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." + "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." ], "type": "string" }, + "spellCorrectionSpec": { + "$ref": "GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec", + "description": "The spell correction specification that specifies the mode under which spell correction will take effect." + }, "userInfo": { "$ref": "GoogleCloudRetailV2alphaUserInfo", "description": "User information." }, "variantRollupKeys": { - "description": "The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of \"fulfillmentType.fulfillmentId\". E.g., in \"pickupInStore.store123\", \"pickupInStore\" is fulfillment type and \"store123\" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"pickup-in-store\". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"ship-to-store\". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"same-day-delivery\". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"next-day-delivery\". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-1\". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-2\". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-3\". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-4\". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-5\". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.", + "description": "The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of \"fulfillmentType.fulfillmentId\". E.g., in \"pickupInStore.store123\", \"pickupInStore\" is fulfillment type and \"store123\" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.local_inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"pickup-in-store\". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"ship-to-store\". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"same-day-delivery\". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"next-day-delivery\". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-1\". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-2\". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-3\". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-4\". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-5\". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.", "items": { "type": "string" }, @@ -4404,6 +4408,27 @@ }, "type": "object" }, + "GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec": { + "description": "The specification for query spell correction.", + "id": "GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec", + "properties": { + "mode": { + "description": "The mode under which spell correction should take effect to replace the original search query. Default to Mode.AUTO.", + "enum": [ + "MODE_UNSPECIFIED", + "SUGGESTION_ONLY", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified spell correction mode. This defaults to Mode.AUTO.", + "Google Retail Search will try to find a spell suggestion if there is any and put in the SearchResponse.corrected_query. The spell suggestion will not be used as the search query.", + "Automatic spell correction built by Google Retail Search. Search will be based on the corrected query if found." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2alphaSearchResponse": { "description": "Response message for SearchService.Search method.", "id": "GoogleCloudRetailV2alphaSearchResponse", @@ -4420,7 +4445,7 @@ "type": "string" }, "correctedQuery": { - "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results will be based on corrected_query, otherwise the original query will be used for search.", + "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query will be used for search.", "type": "string" }, "facets": { @@ -4446,7 +4471,7 @@ "description": "Query expansion information for the returned results." }, "redirectUri": { - "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search will be performed, and only redirect_uri and attribution_token will be set in the response.", + "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.", "type": "string" }, "results": { @@ -4562,7 +4587,7 @@ "id": "GoogleCloudRetailV2alphaServingConfig", "properties": { "boostControlIds": { - "description": "Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100. Notice that if both ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "description": "Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100. Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", "items": { "type": "string" }, @@ -4903,25 +4928,25 @@ "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -4967,7 +4992,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2betaExportErrorsConfig", - "description": "Echoes the destination for the complete errors in the request if set." + "description": "This field is never set." } }, "type": "object" @@ -4985,7 +5010,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2betaExportErrorsConfig", - "description": "Echoes the destination for the complete errors if this field was set in the request." + "description": "This field is never set." } }, "type": "object" diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 61316312f17..5175a3364f1 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -609,26 +609,28 @@ func (s *GoogleCloudRetailLoggingSourceLocation) MarshalJSON() ([]byte, error) { // GoogleCloudRetailV2AddFulfillmentPlacesMetadata: Metadata related to // the progress of the AddFulfillmentPlaces operation. Currently empty // because there is no meaningful metadata populated from the -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2AddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2AddLocalInventoriesMetadata: Metadata related to // the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2AddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesResponse struct { } @@ -1040,12 +1042,12 @@ func (s *GoogleCloudRetailV2alphaAddControlRequest) MarshalJSON() ([]byte, error // GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata // related to the progress of the AddFulfillmentPlaces operation. // Currently empty because there is no meaningful metadata populated -// from the AddFulfillmentPlaces method. +// from the ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest: Request message -// for AddFulfillmentPlaces method. +// for ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest struct { // AddTime: The time when the fulfillment updates are issued, used to // prevent out-of-order updates on fulfillment information. If not @@ -1104,19 +1106,20 @@ func (s *GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest) MarshalJSON() ([]b // GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related // to the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2alphaAddLocalInventoriesRequest: Request message -// for AddLocalInventories method. +// for ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesRequest struct { // AddMask: Indicates which inventory fields in the provided list of // LocalInventory to update. The field is updated to the provided value. @@ -1169,8 +1172,9 @@ func (s *GoogleCloudRetailV2alphaAddLocalInventoriesRequest) MarshalJSON() ([]by } // GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { } @@ -1419,14 +1423,15 @@ type GoogleCloudRetailV2alphaCatalogAttribute struct { // InUse: Output only. Indicates whether this attribute has been used by // any products. `True` if at least one Product is using this attribute // in Product.attributes. Otherwise, this field is `False`. - // CatalogAttribute can be pre-loaded by using AddCatalogAttribute, - // ImportCatalogAttributes, or UpdateAttributesConfig APIs. This field - // is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes - // that are not in use by products can be deleted. CatalogAttributes - // that are in use by products cannot be deleted; however, their - // configuration properties will reset to default values upon removal - // request. After catalog changes, it takes about 10 minutes for this - // field to update. + // CatalogAttribute can be pre-loaded by using + // CatalogService.AddCatalogAttribute, + // CatalogService.ImportCatalogAttributes, or + // CatalogService.UpdateAttributesConfig APIs. This field is `False` for + // pre-loaded CatalogAttributes. Only CatalogAttributes that are not in + // use by products can be deleted. CatalogAttributes that are in use by + // products cannot be deleted; however, their configuration properties + // will reset to default values upon removal request. After catalog + // changes, it takes about 10 minutes for this field to update. InUse bool `json:"inUse,omitempty"` // IndexableOption: When AttributesConfig.attribute_config_level is @@ -2013,10 +2018,10 @@ func (s *GoogleCloudRetailV2alphaControl) MarshalJSON() ([]byte, error) { type GoogleCloudRetailV2alphaCustomAttribute struct { // Indexable: This field is normally ignored unless // AttributesConfig.attribute_config_level of the Catalog is set to the - // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more - // on [configuration mode] + // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information + // about product-level attribute configuration, see Configuration modes // (https://cloud.google.com/retail/docs/attribute-config#config-modes). - // if true, custom attribute values are indexed, so that it can be + // If true, custom attribute values are indexed, so that they can be // filtered, faceted or boosted in SearchService.Search. This field is // ignored in a UserEvent. See SearchRequest.filter, // SearchRequest.facet_specs and SearchRequest.boost_spec for more @@ -2031,8 +2036,8 @@ type GoogleCloudRetailV2alphaCustomAttribute struct { // Searchable: This field is normally ignored unless // AttributesConfig.attribute_config_level of the Catalog is set to the - // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more - // on [configuration mode] + // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information + // about product-level attribute configuration, see Configuration modes // (https://cloud.google.com/retail/docs/attribute-config#config-modes). // If true, custom attribute values are searchable by text queries in // SearchService.Search. This field is ignored in a UserEvent. Only set @@ -2145,8 +2150,7 @@ type GoogleCloudRetailV2alphaExportProductsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -2182,8 +2186,7 @@ type GoogleCloudRetailV2alphaExportUserEventsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -3122,14 +3125,14 @@ type GoogleCloudRetailV2alphaPredictRequest struct { // Labels: The labels applied to a resource must meet the following // requirements: * Each resource can have multiple labels, up to a // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters, - // and cannot be empty. Values can be empty, and have a maximum length - // of 63 characters. * Keys and values can contain only lowercase - // letters, numeric characters, underscores, and dashes. All characters - // must use UTF-8 encoding, and international characters are allowed. * - // The key portion of a label must be unique. However, you can use the - // same key with multiple resources. * Keys must start with a lowercase - // letter or international character. See Google Cloud Document + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) // for more details. Labels map[string]string `json:"labels,omitempty"` @@ -3260,10 +3263,10 @@ type GoogleCloudRetailV2alphaPredictResponsePredictionResult struct { Id string `json:"id,omitempty"` // Metadata: Additional product metadata / annotations. Possible values: - // * `product`: JSON representation of the product. Will be set if + // * `product`: JSON representation of the product. Is set if // `returnProduct` is set to true in `PredictRequest.params`. * `score`: - // Prediction score in double value. Will be set if `returnScore` is set - // to true in `PredictRequest.params`. + // Prediction score in double value. Is set if `returnScore` is set to + // true in `PredictRequest.params`. Metadata googleapi.RawMessage `json:"metadata,omitempty"` // ForceSendFields is a list of field names (e.g. "Id") to @@ -3652,9 +3655,9 @@ type GoogleCloudRetailV2alphaProduct struct { // Type.PRIMARY and Type.COLLECTION, the following fields are always // returned in SearchResponse by default: * name For Type.VARIANT, the // following fields are always returned in by default: * name * - // color_info Maximum number of paths is 30. Otherwise, an + // color_info The maximum number of paths is 30. Otherwise, an // INVALID_ARGUMENT error is returned. Note: Returning more fields in - // SearchResponse may increase response payload size and serving + // SearchResponse can increase response payload size and serving // latency. RetrievableFields string `json:"retrievableFields,omitempty"` @@ -4977,8 +4980,8 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // BoostSpec: Boost specification to boost certain products. See more // details at this user guide // (https://cloud.google.com/retail/docs/boosting). Notice that if both - // ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are - // set, the boost conditions from both places are evaluated. If a search + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search // request matches multiple boost conditions, the final boost score is // equal to the sum of the boost scores from all matched boost // conditions. @@ -5024,14 +5027,14 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // Labels: The labels applied to a resource must meet the following // requirements: * Each resource can have multiple labels, up to a // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters, - // and cannot be empty. Values can be empty, and have a maximum length - // of 63 characters. * Keys and values can contain only lowercase - // letters, numeric characters, underscores, and dashes. All characters - // must use UTF-8 encoding, and international characters are allowed. * - // The key portion of a label must be unique. However, you can use the - // same key with multiple resources. * Keys must start with a lowercase - // letter or international character. See Google Cloud Document + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) // for more details. Labels map[string]string `json:"labels,omitempty"` @@ -5120,12 +5123,16 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // set. // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The // product search will be disabled. When in this mode, one or both of - // SearchRequest.facet_spec and SearchRequest.dynamic_facet_spec should + // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only // [SearchResponse.Facet] will be returned. // [SearchResponse.SearchResult] will not be returned. SearchMode string `json:"searchMode,omitempty"` + // SpellCorrectionSpec: The spell correction specification that + // specifies the mode under which spell correction will take effect. + SpellCorrectionSpec *GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + // UserInfo: User information. UserInfo *GoogleCloudRetailV2alphaUserInfo `json:"userInfo,omitempty"` @@ -5141,9 +5148,9 @@ type GoogleCloudRetailV2alphaSearchRequest struct { // colorFamilies * price * originalPrice * discount * variantId * // inventory(place_id,price) * inventory(place_id,original_price) * // inventory(place_id,attributes.key), where key is any key in the - // Product.inventories.attributes map. * attributes.key, where key is - // any key in the Product.attributes map. * pickupInStore.id, where id - // is any FulfillmentInfo.place_ids for FulfillmentInfo.type + // Product.local_inventories.attributes map. * attributes.key, where key + // is any key in the Product.attributes map. * pickupInStore.id, where + // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type // "pickup-in-store". * shipToStore.id, where id is any // FulfillmentInfo.place_ids for FulfillmentInfo.type "ship-to-store". * // sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for @@ -5576,6 +5583,46 @@ func (s *GoogleCloudRetailV2alphaSearchRequestQueryExpansionSpec) MarshalJSON() return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec: The +// specification for query spell correction. +type GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec struct { + // Mode: The mode under which spell correction should take effect to + // replace the original search query. Default to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Unspecified spell correction mode. This + // defaults to Mode.AUTO. + // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell + // suggestion if there is any and put in the + // SearchResponse.corrected_query. The spell suggestion will not be used + // as the search query. + // "AUTO" - Automatic spell correction built by Google Retail Search. + // Search will be based on the corrected query if found. + Mode string `json:"mode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Mode") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2alphaSearchResponse: Response message for // SearchService.Search method. type GoogleCloudRetailV2alphaSearchResponse struct { @@ -5590,9 +5637,9 @@ type GoogleCloudRetailV2alphaSearchResponse struct { AttributionToken string `json:"attributionToken,omitempty"` // CorrectedQuery: Contains the spell corrected query, if found. If the - // spell correction type is AUTOMATIC, then the search results will be - // based on corrected_query, otherwise the original query will be used - // for search. + // spell correction type is AUTOMATIC, then the search results are based + // on corrected_query. Otherwise the original query will be used for + // search. CorrectedQuery string `json:"correctedQuery,omitempty"` // Facets: Results of facets requested by user. @@ -5613,8 +5660,8 @@ type GoogleCloudRetailV2alphaSearchResponse struct { QueryExpansionInfo *GoogleCloudRetailV2alphaSearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` // RedirectUri: The URI of a customer-defined redirect page. If redirect - // action is triggered, no search will be performed, and only - // redirect_uri and attribution_token will be set in the response. + // action is triggered, no search is performed, and only redirect_uri + // and attribution_token are set in the response. RedirectUri string `json:"redirectUri,omitempty"` // Results: A list of matched items. The order represents the ranking. @@ -5839,8 +5886,8 @@ type GoogleCloudRetailV2alphaServingConfig struct { // multiple conditions in the specifications, boost scores from these // specifications are all applied and combined in a non-linear way. // Maximum number of specifications is 100. Notice that if both - // ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are - // set, the boost conditions from both places are evaluated. If a search + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search // request matches multiple boost conditions, the final boost score is // equal to the sum of the boost scores from all matched boost // conditions. Can only be set if solution_types is @@ -6497,26 +6544,28 @@ func (s *GoogleCloudRetailV2alphaUserInfo) MarshalJSON() ([]byte, error) { // GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related // to the progress of the AddFulfillmentPlaces operation. Currently // empty because there is no meaningful metadata populated from the -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related // to the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { } @@ -6596,8 +6645,7 @@ type GoogleCloudRetailV2betaExportProductsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -6633,8 +6681,7 @@ type GoogleCloudRetailV2betaExportUserEventsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -11193,9 +11240,10 @@ type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { // no inventory fields are set in SetInventoryRequest.set_mask, then any // existing inventory information will be preserved. Pre-existing // inventory information can only be updated with SetInventory, -// AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is -// only available for users who have Retail Search enabled. Please -// enable Retail Search on Cloud Console before using this feature. +// ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. +// This feature is only available for users who have Retail Search +// enabled. Please enable Retail Search on Cloud Console before using +// this feature. // // - name: Immutable. Full resource name of the product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -11298,7 +11346,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } return ret, nil // { - // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.setInventory", diff --git a/retail/v2beta/retail-api.json b/retail/v2beta/retail-api.json index a75015f8d4c..0a5b60b6689 100644 --- a/retail/v2beta/retail-api.json +++ b/retail/v2beta/retail-api.json @@ -842,7 +842,7 @@ ] }, "setInventory": { - "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", "httpMethod": "POST", "id": "retail.projects.locations.catalogs.branches.products.setInventory", @@ -1714,7 +1714,7 @@ } } }, - "revision": "20220430", + "revision": "20220505", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1868,25 +1868,25 @@ "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2AddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2AddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2AddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -2081,25 +2081,25 @@ "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2alphaAddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2alphaAddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -2145,7 +2145,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2alphaExportErrorsConfig", - "description": "Echoes the destination for the complete errors in the request if set." + "description": "This field is never set." } }, "type": "object" @@ -2163,7 +2163,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2alphaExportErrorsConfig", - "description": "Echoes the destination for the complete errors if this field was set in the request." + "description": "This field is never set." } }, "type": "object" @@ -2426,13 +2426,13 @@ "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata": { - "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the AddFulfillmentPlaces method.", + "description": "Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesRequest": { - "description": "Request message for AddFulfillmentPlaces method.", + "description": "Request message for ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesRequest", "properties": { "addTime": { @@ -2459,19 +2459,19 @@ "type": "object" }, "GoogleCloudRetailV2betaAddFulfillmentPlacesResponse": { - "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the AddFulfillmentPlaces method.", + "description": "Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.", "id": "GoogleCloudRetailV2betaAddFulfillmentPlacesResponse", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesMetadata": { - "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the AddLocalInventories method.", + "description": "Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesMetadata", "properties": {}, "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesRequest": { - "description": "Request message for AddLocalInventories method.", + "description": "Request message for ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesRequest", "properties": { "addMask": { @@ -2499,7 +2499,7 @@ "type": "object" }, "GoogleCloudRetailV2betaAddLocalInventoriesResponse": { - "description": "Response of the AddLocalInventories API. Currently empty because there is no meaningful response populated from the AddLocalInventories method.", + "description": "Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.", "id": "GoogleCloudRetailV2betaAddLocalInventoriesResponse", "properties": {}, "type": "object" @@ -2631,7 +2631,7 @@ "type": "string" }, "inUse": { - "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using AddCatalogAttribute, ImportCatalogAttributes, or UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes that are not in use by products can be deleted. CatalogAttributes that are in use by products cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", + "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes that are not in use by products can be deleted. CatalogAttributes that are in use by products cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", "readOnly": true, "type": "boolean" }, @@ -2956,7 +2956,7 @@ "id": "GoogleCloudRetailV2betaCustomAttribute", "properties": { "indexable": { - "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more on [configuration mode] (https://cloud.google.com/retail/docs/attribute-config#config-modes). if true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.", + "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are indexed, so that they can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details.", "type": "boolean" }, "numbers": { @@ -2968,7 +2968,7 @@ "type": "array" }, "searchable": { - "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more on [configuration mode] (https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.", + "description": "This field is normally ignored unless AttributesConfig.attribute_config_level of the Catalog is set to the deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level attribute configuration, see [Configuration modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned.", "type": "boolean" }, "text": { @@ -3022,7 +3022,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2betaExportErrorsConfig", - "description": "Echoes the destination for the complete errors in the request if set." + "description": "This field is never set." } }, "type": "object" @@ -3040,7 +3040,7 @@ }, "errorsConfig": { "$ref": "GoogleCloudRetailV2betaExportErrorsConfig", - "description": "Echoes the destination for the complete errors if this field was set in the request." + "description": "This field is never set." } }, "type": "object" @@ -3479,7 +3479,7 @@ "additionalProperties": { "type": "string" }, - "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", "type": "object" }, "pageSize": { @@ -3550,7 +3550,7 @@ "additionalProperties": { "type": "any" }, - "description": "Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Will be set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Will be set if `returnScore` is set to true in `PredictRequest.params`.", + "description": "Additional product metadata / annotations. Possible values: * `product`: JSON representation of the product. Is set if `returnProduct` is set to true in `PredictRequest.params`. * `score`: Prediction score in double value. Is set if `returnScore` is set to true in `PredictRequest.params`.", "type": "object" } }, @@ -3765,7 +3765,7 @@ "description": "The rating of this product." }, "retrievableFields": { - "description": "Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form \"attributes.key\" where \"key\" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse may increase response payload size and serving latency.", + "description": "Indicates which fields in the Products are returned in SearchResponse. Supported fields for all types: * audience * availability * brands * color_info * conditions * gtin * materials * name * patterns * price_info * rating * sizes * title * uri Supported fields only for Type.PRIMARY and Type.COLLECTION: * categories * description * images Supported fields only for Type.VARIANT: * Only the first image in images To mark attributes as retrievable, include paths of the form \"attributes.key\" where \"key\" is the key of a custom attribute, as specified in attributes. For Type.PRIMARY and Type.COLLECTION, the following fields are always returned in SearchResponse by default: * name For Type.VARIANT, the following fields are always returned in by default: * name * color_info The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is returned. Note: Returning more fields in SearchResponse can increase response payload size and serving latency.", "format": "google-fieldmask", "type": "string" }, @@ -4330,7 +4330,7 @@ "properties": { "boostSpec": { "$ref": "GoogleCloudRetailV2betaSearchRequestBoostSpec", - "description": "Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions." + "description": "Boost specification to boost certain products. See more details at this [user guide](https://cloud.google.com/retail/docs/boosting). Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions." }, "branch": { "description": "The branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use \"default_branch\" as the branch ID or leave this field empty, to search products under the default branch.", @@ -4359,7 +4359,7 @@ "additionalProperties": { "type": "string" }, - "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "description": "The labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", "type": "object" }, "offset": { @@ -4409,16 +4409,20 @@ "enumDescriptions": [ "Default value. In this case both product search and faceted search will be performed. Both [SearchResponse.SearchResult] and [SearchResponse.Facet] will be returned.", "Only product search will be performed. The faceted search will be disabled. Only [SearchResponse.SearchResult] will be returned. [SearchResponse.Facet] will not be returned, even if SearchRequest.facet_specs or SearchRequest.dynamic_facet_spec is set.", - "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_spec and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." + "Only faceted search will be performed. The product search will be disabled. When in this mode, one or both of SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] will not be returned." ], "type": "string" }, + "spellCorrectionSpec": { + "$ref": "GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec", + "description": "The spell correction specification that specifies the mode under which spell correction will take effect." + }, "userInfo": { "$ref": "GoogleCloudRetailV2betaUserInfo", "description": "User information." }, "variantRollupKeys": { - "description": "The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of \"fulfillmentType.fulfillmentId\". E.g., in \"pickupInStore.store123\", \"pickupInStore\" is fulfillment type and \"store123\" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"pickup-in-store\". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"ship-to-store\". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"same-day-delivery\". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"next-day-delivery\". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-1\". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-2\". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-3\". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-4\". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-5\". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.", + "description": "The keys to fetch and rollup the matching variant Products attributes, FulfillmentInfo or LocalInventorys attributes. The attributes from all the matching variant Products or LocalInventorys are merged and de-duplicated. Notice that rollup attributes will lead to extra query latency. Maximum number of keys is 30. For FulfillmentInfo, a fulfillment type and a fulfillment ID must be provided in the format of \"fulfillmentType.fulfillmentId\". E.g., in \"pickupInStore.store123\", \"pickupInStore\" is fulfillment type and \"store123\" is the store ID. Supported keys are: * colorFamilies * price * originalPrice * discount * variantId * inventory(place_id,price) * inventory(place_id,original_price) * inventory(place_id,attributes.key), where key is any key in the Product.local_inventories.attributes map. * attributes.key, where key is any key in the Product.attributes map. * pickupInStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"pickup-in-store\". * shipToStore.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"ship-to-store\". * sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"same-day-delivery\". * nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"next-day-delivery\". * customFulfillment1.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-1\". * customFulfillment2.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-2\". * customFulfillment3.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-3\". * customFulfillment4.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-4\". * customFulfillment5.id, where id is any FulfillmentInfo.place_ids for FulfillmentInfo.type \"custom-type-5\". If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.", "items": { "type": "string" }, @@ -4606,6 +4610,27 @@ }, "type": "object" }, + "GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec": { + "description": "The specification for query spell correction.", + "id": "GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec", + "properties": { + "mode": { + "description": "The mode under which spell correction should take effect to replace the original search query. Default to Mode.AUTO.", + "enum": [ + "MODE_UNSPECIFIED", + "SUGGESTION_ONLY", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified spell correction mode. This defaults to Mode.AUTO.", + "Google Retail Search will try to find a spell suggestion if there is any and put in the SearchResponse.corrected_query. The spell suggestion will not be used as the search query.", + "Automatic spell correction built by Google Retail Search. Search will be based on the corrected query if found." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudRetailV2betaSearchResponse": { "description": "Response message for SearchService.Search method.", "id": "GoogleCloudRetailV2betaSearchResponse", @@ -4622,7 +4647,7 @@ "type": "string" }, "correctedQuery": { - "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results will be based on corrected_query, otherwise the original query will be used for search.", + "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query will be used for search.", "type": "string" }, "facets": { @@ -4648,7 +4673,7 @@ "description": "Query expansion information for the returned results." }, "redirectUri": { - "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search will be performed, and only redirect_uri and attribution_token will be set in the response.", + "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.", "type": "string" }, "results": { @@ -4764,7 +4789,7 @@ "id": "GoogleCloudRetailV2betaServingConfig", "properties": { "boostControlIds": { - "description": "Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100. Notice that if both ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", + "description": "Condition boost specifications. If a product matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 100. Notice that if both ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the boost conditions from both places are evaluated. If a search request matches multiple boost conditions, the final boost score is equal to the sum of the boost scores from all matched boost conditions. Can only be set if solution_types is SOLUTION_TYPE_SEARCH.", "items": { "type": "string" }, diff --git a/retail/v2beta/retail-gen.go b/retail/v2beta/retail-gen.go index 2139078f140..36b8d6f42f8 100644 --- a/retail/v2beta/retail-gen.go +++ b/retail/v2beta/retail-gen.go @@ -609,26 +609,28 @@ func (s *GoogleCloudRetailLoggingSourceLocation) MarshalJSON() ([]byte, error) { // GoogleCloudRetailV2AddFulfillmentPlacesMetadata: Metadata related to // the progress of the AddFulfillmentPlaces operation. Currently empty // because there is no meaningful metadata populated from the -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2AddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2AddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2AddLocalInventoriesMetadata: Metadata related to // the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2AddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2AddLocalInventoriesResponse struct { } @@ -979,26 +981,28 @@ func (s *GoogleCloudRetailV2UserEventImportSummary) MarshalJSON() ([]byte, error // GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata // related to the progress of the AddFulfillmentPlaces operation. // Currently empty because there is no meaningful metadata populated -// from the AddFulfillmentPlaces method. +// from the ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related // to the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { } @@ -1078,8 +1082,7 @@ type GoogleCloudRetailV2alphaExportProductsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -1115,8 +1118,7 @@ type GoogleCloudRetailV2alphaExportUserEventsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -1628,12 +1630,12 @@ func (s *GoogleCloudRetailV2betaAddControlRequest) MarshalJSON() ([]byte, error) // GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related // to the progress of the AddFulfillmentPlaces operation. Currently // empty because there is no meaningful metadata populated from the -// AddFulfillmentPlaces method. +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { } // GoogleCloudRetailV2betaAddFulfillmentPlacesRequest: Request message -// for AddFulfillmentPlaces method. +// for ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesRequest struct { // AddTime: The time when the fulfillment updates are issued, used to // prevent out-of-order updates on fulfillment information. If not @@ -1692,19 +1694,20 @@ func (s *GoogleCloudRetailV2betaAddFulfillmentPlacesRequest) MarshalJSON() ([]by // GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the // AddFulfillmentPlacesRequest. Currently empty because there is no -// meaningful response populated from the AddFulfillmentPlaces method. +// meaningful response populated from the +// ProductService.AddFulfillmentPlaces method. type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { } // GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related // to the progress of the AddLocalInventories operation. Currently empty // because there is no meaningful metadata populated from the -// AddLocalInventories method. +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { } // GoogleCloudRetailV2betaAddLocalInventoriesRequest: Request message -// for AddLocalInventories method. +// for ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesRequest struct { // AddMask: Indicates which inventory fields in the provided list of // LocalInventory to update. The field is updated to the provided value. @@ -1757,8 +1760,9 @@ func (s *GoogleCloudRetailV2betaAddLocalInventoriesRequest) MarshalJSON() ([]byt } // GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the -// AddLocalInventories API. Currently empty because there is no -// meaningful response populated from the AddLocalInventories method. +// ProductService.AddLocalInventories API. Currently empty because there +// is no meaningful response populated from the +// ProductService.AddLocalInventories method. type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { } @@ -2007,14 +2011,15 @@ type GoogleCloudRetailV2betaCatalogAttribute struct { // InUse: Output only. Indicates whether this attribute has been used by // any products. `True` if at least one Product is using this attribute // in Product.attributes. Otherwise, this field is `False`. - // CatalogAttribute can be pre-loaded by using AddCatalogAttribute, - // ImportCatalogAttributes, or UpdateAttributesConfig APIs. This field - // is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes - // that are not in use by products can be deleted. CatalogAttributes - // that are in use by products cannot be deleted; however, their - // configuration properties will reset to default values upon removal - // request. After catalog changes, it takes about 10 minutes for this - // field to update. + // CatalogAttribute can be pre-loaded by using + // CatalogService.AddCatalogAttribute, + // CatalogService.ImportCatalogAttributes, or + // CatalogService.UpdateAttributesConfig APIs. This field is `False` for + // pre-loaded CatalogAttributes. Only CatalogAttributes that are not in + // use by products can be deleted. CatalogAttributes that are in use by + // products cannot be deleted; however, their configuration properties + // will reset to default values upon removal request. After catalog + // changes, it takes about 10 minutes for this field to update. InUse bool `json:"inUse,omitempty"` // IndexableOption: When AttributesConfig.attribute_config_level is @@ -2600,10 +2605,10 @@ func (s *GoogleCloudRetailV2betaControl) MarshalJSON() ([]byte, error) { type GoogleCloudRetailV2betaCustomAttribute struct { // Indexable: This field is normally ignored unless // AttributesConfig.attribute_config_level of the Catalog is set to the - // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more - // on [configuration mode] + // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information + // about product-level attribute configuration, see Configuration modes // (https://cloud.google.com/retail/docs/attribute-config#config-modes). - // if true, custom attribute values are indexed, so that it can be + // If true, custom attribute values are indexed, so that they can be // filtered, faceted or boosted in SearchService.Search. This field is // ignored in a UserEvent. See SearchRequest.filter, // SearchRequest.facet_specs and SearchRequest.boost_spec for more @@ -2618,8 +2623,8 @@ type GoogleCloudRetailV2betaCustomAttribute struct { // Searchable: This field is normally ignored unless // AttributesConfig.attribute_config_level of the Catalog is set to the - // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. You may learn more - // on [configuration mode] + // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information + // about product-level attribute configuration, see Configuration modes // (https://cloud.google.com/retail/docs/attribute-config#config-modes). // If true, custom attribute values are searchable by text queries in // SearchService.Search. This field is ignored in a UserEvent. Only set @@ -2732,8 +2737,7 @@ type GoogleCloudRetailV2betaExportProductsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors in the - // request if set. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -2769,8 +2773,7 @@ type GoogleCloudRetailV2betaExportUserEventsResponse struct { // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ErrorsConfig: Echoes the destination for the complete errors if this - // field was set in the request. + // ErrorsConfig: This field is never set. ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorSamples") to @@ -3695,14 +3698,14 @@ type GoogleCloudRetailV2betaPredictRequest struct { // Labels: The labels applied to a resource must meet the following // requirements: * Each resource can have multiple labels, up to a // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters, - // and cannot be empty. Values can be empty, and have a maximum length - // of 63 characters. * Keys and values can contain only lowercase - // letters, numeric characters, underscores, and dashes. All characters - // must use UTF-8 encoding, and international characters are allowed. * - // The key portion of a label must be unique. However, you can use the - // same key with multiple resources. * Keys must start with a lowercase - // letter or international character. See Google Cloud Document + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) // for more details. Labels map[string]string `json:"labels,omitempty"` @@ -3833,10 +3836,10 @@ type GoogleCloudRetailV2betaPredictResponsePredictionResult struct { Id string `json:"id,omitempty"` // Metadata: Additional product metadata / annotations. Possible values: - // * `product`: JSON representation of the product. Will be set if + // * `product`: JSON representation of the product. Is set if // `returnProduct` is set to true in `PredictRequest.params`. * `score`: - // Prediction score in double value. Will be set if `returnScore` is set - // to true in `PredictRequest.params`. + // Prediction score in double value. Is set if `returnScore` is set to + // true in `PredictRequest.params`. Metadata googleapi.RawMessage `json:"metadata,omitempty"` // ForceSendFields is a list of field names (e.g. "Id") to @@ -4224,9 +4227,9 @@ type GoogleCloudRetailV2betaProduct struct { // Type.PRIMARY and Type.COLLECTION, the following fields are always // returned in SearchResponse by default: * name For Type.VARIANT, the // following fields are always returned in by default: * name * - // color_info Maximum number of paths is 30. Otherwise, an + // color_info The maximum number of paths is 30. Otherwise, an // INVALID_ARGUMENT error is returned. Note: Returning more fields in - // SearchResponse may increase response payload size and serving + // SearchResponse can increase response payload size and serving // latency. RetrievableFields string `json:"retrievableFields,omitempty"` @@ -5421,8 +5424,8 @@ type GoogleCloudRetailV2betaSearchRequest struct { // BoostSpec: Boost specification to boost certain products. See more // details at this user guide // (https://cloud.google.com/retail/docs/boosting). Notice that if both - // ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are - // set, the boost conditions from both places are evaluated. If a search + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search // request matches multiple boost conditions, the final boost score is // equal to the sum of the boost scores from all matched boost // conditions. @@ -5468,14 +5471,14 @@ type GoogleCloudRetailV2betaSearchRequest struct { // Labels: The labels applied to a resource must meet the following // requirements: * Each resource can have multiple labels, up to a // maximum of 64. * Each label must be a key-value pair. * Keys have a - // minimum length of 1 character and a maximum length of 63 characters, - // and cannot be empty. Values can be empty, and have a maximum length - // of 63 characters. * Keys and values can contain only lowercase - // letters, numeric characters, underscores, and dashes. All characters - // must use UTF-8 encoding, and international characters are allowed. * - // The key portion of a label must be unique. However, you can use the - // same key with multiple resources. * Keys must start with a lowercase - // letter or international character. See Google Cloud Document + // minimum length of 1 character and a maximum length of 63 characters + // and cannot be empty. Values can be empty and have a maximum length of + // 63 characters. * Keys and values can contain only lowercase letters, + // numeric characters, underscores, and dashes. All characters must use + // UTF-8 encoding, and international characters are allowed. * The key + // portion of a label must be unique. However, you can use the same key + // with multiple resources. * Keys must start with a lowercase letter or + // international character. See Google Cloud Document // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) // for more details. Labels map[string]string `json:"labels,omitempty"` @@ -5549,12 +5552,16 @@ type GoogleCloudRetailV2betaSearchRequest struct { // set. // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The // product search will be disabled. When in this mode, one or both of - // SearchRequest.facet_spec and SearchRequest.dynamic_facet_spec should + // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should // be set. Otherwise, an INVALID_ARGUMENT error is returned. Only // [SearchResponse.Facet] will be returned. // [SearchResponse.SearchResult] will not be returned. SearchMode string `json:"searchMode,omitempty"` + // SpellCorrectionSpec: The spell correction specification that + // specifies the mode under which spell correction will take effect. + SpellCorrectionSpec *GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + // UserInfo: User information. UserInfo *GoogleCloudRetailV2betaUserInfo `json:"userInfo,omitempty"` @@ -5570,9 +5577,9 @@ type GoogleCloudRetailV2betaSearchRequest struct { // colorFamilies * price * originalPrice * discount * variantId * // inventory(place_id,price) * inventory(place_id,original_price) * // inventory(place_id,attributes.key), where key is any key in the - // Product.inventories.attributes map. * attributes.key, where key is - // any key in the Product.attributes map. * pickupInStore.id, where id - // is any FulfillmentInfo.place_ids for FulfillmentInfo.type + // Product.local_inventories.attributes map. * attributes.key, where key + // is any key in the Product.attributes map. * pickupInStore.id, where + // id is any FulfillmentInfo.place_ids for FulfillmentInfo.type // "pickup-in-store". * shipToStore.id, where id is any // FulfillmentInfo.place_ids for FulfillmentInfo.type "ship-to-store". * // sameDayDelivery.id, where id is any FulfillmentInfo.place_ids for @@ -6004,6 +6011,46 @@ func (s *GoogleCloudRetailV2betaSearchRequestQueryExpansionSpec) MarshalJSON() ( return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec: The +// specification for query spell correction. +type GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec struct { + // Mode: The mode under which spell correction should take effect to + // replace the original search query. Default to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Unspecified spell correction mode. This + // defaults to Mode.AUTO. + // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell + // suggestion if there is any and put in the + // SearchResponse.corrected_query. The spell suggestion will not be used + // as the search query. + // "AUTO" - Automatic spell correction built by Google Retail Search. + // Search will be based on the corrected query if found. + Mode string `json:"mode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Mode") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudRetailV2betaSearchResponse: Response message for // SearchService.Search method. type GoogleCloudRetailV2betaSearchResponse struct { @@ -6018,9 +6065,9 @@ type GoogleCloudRetailV2betaSearchResponse struct { AttributionToken string `json:"attributionToken,omitempty"` // CorrectedQuery: Contains the spell corrected query, if found. If the - // spell correction type is AUTOMATIC, then the search results will be - // based on corrected_query, otherwise the original query will be used - // for search. + // spell correction type is AUTOMATIC, then the search results are based + // on corrected_query. Otherwise the original query will be used for + // search. CorrectedQuery string `json:"correctedQuery,omitempty"` // Facets: Results of facets requested by user. @@ -6041,8 +6088,8 @@ type GoogleCloudRetailV2betaSearchResponse struct { QueryExpansionInfo *GoogleCloudRetailV2betaSearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` // RedirectUri: The URI of a customer-defined redirect page. If redirect - // action is triggered, no search will be performed, and only - // redirect_uri and attribution_token will be set in the response. + // action is triggered, no search is performed, and only redirect_uri + // and attribution_token are set in the response. RedirectUri string `json:"redirectUri,omitempty"` // Results: A list of matched items. The order represents the ranking. @@ -6267,8 +6314,8 @@ type GoogleCloudRetailV2betaServingConfig struct { // multiple conditions in the specifications, boost scores from these // specifications are all applied and combined in a non-linear way. // Maximum number of specifications is 100. Notice that if both - // ServingConfig.boost_control_ids and [SearchRequest.boost_spec] are - // set, the boost conditions from both places are evaluated. If a search + // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, + // the boost conditions from both places are evaluated. If a search // request matches multiple boost conditions, the final boost score is // equal to the sum of the boost scores from all matched boost // conditions. Can only be set if solution_types is @@ -10938,9 +10985,10 @@ type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { // no inventory fields are set in SetInventoryRequest.set_mask, then any // existing inventory information will be preserved. Pre-existing // inventory information can only be updated with SetInventory, -// AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is -// only available for users who have Retail Search enabled. Please -// enable Retail Search on Cloud Console before using this feature. +// ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. +// This feature is only available for users who have Retail Search +// enabled. Please enable Retail Search on Cloud Console before using +// this feature. // // - name: Immutable. Full resource name of the product, such as // `projects/*/locations/global/catalogs/default_catalog/branches/defau @@ -11043,7 +11091,7 @@ func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...g } return ret, nil // { - // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + // "description": "Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by GetProduct or ListProducts. When inventory is updated with CreateProduct and UpdateProduct, the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the CreateProduct or UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product will be used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with SetInventory, ProductService.AddFulfillmentPlaces, and RemoveFulfillmentPlaces. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}:setInventory", // "httpMethod": "POST", // "id": "retail.projects.locations.catalogs.branches.products.setInventory", diff --git a/run/v1/run-api.json b/run/v1/run-api.json index 60f01bb3e38..2666310e9e8 100644 --- a/run/v1/run-api.json +++ b/run/v1/run-api.json @@ -1670,7 +1670,7 @@ "type": "integer" }, "resource": { - "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", "required": true, @@ -1695,7 +1695,7 @@ ], "parameters": { "resource": { - "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", "required": true, @@ -1723,7 +1723,7 @@ ], "parameters": { "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", "required": true, @@ -2089,7 +2089,7 @@ "type": "integer" }, "resource": { - "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", "required": true, @@ -2208,7 +2208,7 @@ ], "parameters": { "resource": { - "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", "required": true, @@ -2236,7 +2236,7 @@ ], "parameters": { "resource": { - "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", "required": true, @@ -2261,7 +2261,7 @@ } } }, - "revision": "20220429", + "revision": "20220506", "rootUrl": "https://run.googleapis.com/", "schemas": { "Addressable": { diff --git a/run/v1/run-gen.go b/run/v1/run-gen.go index 8ee3d504d05..ff38f061f30 100644 --- a/run/v1/run-gen.go +++ b/run/v1/run-gen.go @@ -11371,8 +11371,9 @@ type ProjectsLocationsJobsGetIamPolicyCall struct { // policies. // // - resource: REQUIRED: The resource for which the policy is being -// requested. See the operation documentation for the appropriate -// value for this field. +// requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. func (r *ProjectsLocationsJobsService) GetIamPolicy(resource string) *ProjectsLocationsJobsGetIamPolicyCall { c := &ProjectsLocationsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -11511,7 +11512,7 @@ func (c *ProjectsLocationsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) // "type": "integer" // }, // "resource": { - // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", // "required": true, @@ -11544,8 +11545,9 @@ type ProjectsLocationsJobsSetIamPolicyCall struct { // job. Overwrites any existing policy. // // - resource: REQUIRED: The resource for which the policy is being -// specified. See the operation documentation for the appropriate -// value for this field. +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. func (r *ProjectsLocationsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsJobsSetIamPolicyCall { c := &ProjectsLocationsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -11653,7 +11655,7 @@ func (c *ProjectsLocationsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) // ], // "parameters": { // "resource": { - // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", // "required": true, @@ -11690,7 +11692,8 @@ type ProjectsLocationsJobsTestIamPermissionsCall struct { // call. // // - resource: REQUIRED: The resource for which the policy detail is -// being requested. See the operation documentation for the +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the // appropriate value for this field. func (r *ProjectsLocationsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsJobsTestIamPermissionsCall { c := &ProjectsLocationsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -11799,7 +11802,7 @@ func (c *ProjectsLocationsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallO // ], // "parameters": { // "resource": { - // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/jobs/[^/]+$", // "required": true, @@ -13295,8 +13298,9 @@ type ProjectsLocationsServicesGetIamPolicyCall struct { // inherited policies. // // - resource: REQUIRED: The resource for which the policy is being -// requested. See the operation documentation for the appropriate -// value for this field. +// requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. func (r *ProjectsLocationsServicesService) GetIamPolicy(resource string) *ProjectsLocationsServicesGetIamPolicyCall { c := &ProjectsLocationsServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -13435,7 +13439,7 @@ func (c *ProjectsLocationsServicesGetIamPolicyCall) Do(opts ...googleapi.CallOpt // "type": "integer" // }, // "resource": { - // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", // "required": true, @@ -13869,8 +13873,9 @@ type ProjectsLocationsServicesSetIamPolicyCall struct { // Service. Overwrites any existing policy. // // - resource: REQUIRED: The resource for which the policy is being -// specified. See the operation documentation for the appropriate -// value for this field. +// specified. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the +// appropriate value for this field. func (r *ProjectsLocationsServicesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsServicesSetIamPolicyCall { c := &ProjectsLocationsServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.resource = resource @@ -13978,7 +13983,7 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Do(opts ...googleapi.CallOpt // ], // "parameters": { // "resource": { - // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", // "required": true, @@ -14015,7 +14020,8 @@ type ProjectsLocationsServicesTestIamPermissionsCall struct { // API call. // // - resource: REQUIRED: The resource for which the policy detail is -// being requested. See the operation documentation for the +// being requested. See Resource names +// (https://cloud.google.com/apis/design/resource_names) for the // appropriate value for this field. func (r *ProjectsLocationsServicesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsServicesTestIamPermissionsCall { c := &ProjectsLocationsServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -14124,7 +14130,7 @@ func (c *ProjectsLocationsServicesTestIamPermissionsCall) Do(opts ...googleapi.C // ], // "parameters": { // "resource": { - // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", + // "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", // "required": true,