From 27219e5f63a3976ee3a275ac262bd2198483db2f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Thu, 31 Mar 2022 01:38:24 +0000 Subject: [PATCH] feat(androidpublisher): update the API #### androidpublisher:v3 The following keys were added: - resources.applications.resources.deviceTierConfigs.methods.create.description - resources.applications.resources.deviceTierConfigs.methods.create.flatPath - resources.applications.resources.deviceTierConfigs.methods.create.httpMethod - resources.applications.resources.deviceTierConfigs.methods.create.id - resources.applications.resources.deviceTierConfigs.methods.create.parameterOrder - resources.applications.resources.deviceTierConfigs.methods.create.parameters.allowUnknownDevices.description - resources.applications.resources.deviceTierConfigs.methods.create.parameters.allowUnknownDevices.location - resources.applications.resources.deviceTierConfigs.methods.create.parameters.allowUnknownDevices.type - resources.applications.resources.deviceTierConfigs.methods.create.parameters.packageName.description - resources.applications.resources.deviceTierConfigs.methods.create.parameters.packageName.location - resources.applications.resources.deviceTierConfigs.methods.create.parameters.packageName.required - resources.applications.resources.deviceTierConfigs.methods.create.parameters.packageName.type - resources.applications.resources.deviceTierConfigs.methods.create.path - resources.applications.resources.deviceTierConfigs.methods.create.request.$ref - resources.applications.resources.deviceTierConfigs.methods.create.response.$ref - resources.applications.resources.deviceTierConfigs.methods.create.scopes - resources.applications.resources.deviceTierConfigs.methods.get.description - resources.applications.resources.deviceTierConfigs.methods.get.flatPath - resources.applications.resources.deviceTierConfigs.methods.get.httpMethod - resources.applications.resources.deviceTierConfigs.methods.get.id - resources.applications.resources.deviceTierConfigs.methods.get.parameterOrder - resources.applications.resources.deviceTierConfigs.methods.get.parameters.deviceTierConfigId.description - resources.applications.resources.deviceTierConfigs.methods.get.parameters.deviceTierConfigId.format - resources.applications.resources.deviceTierConfigs.methods.get.parameters.deviceTierConfigId.location - resources.applications.resources.deviceTierConfigs.methods.get.parameters.deviceTierConfigId.required - resources.applications.resources.deviceTierConfigs.methods.get.parameters.deviceTierConfigId.type - resources.applications.resources.deviceTierConfigs.methods.get.parameters.packageName.description - resources.applications.resources.deviceTierConfigs.methods.get.parameters.packageName.location - resources.applications.resources.deviceTierConfigs.methods.get.parameters.packageName.required - resources.applications.resources.deviceTierConfigs.methods.get.parameters.packageName.type - resources.applications.resources.deviceTierConfigs.methods.get.path - resources.applications.resources.deviceTierConfigs.methods.get.response.$ref - resources.applications.resources.deviceTierConfigs.methods.get.scopes - resources.applications.resources.deviceTierConfigs.methods.list.description - resources.applications.resources.deviceTierConfigs.methods.list.flatPath - resources.applications.resources.deviceTierConfigs.methods.list.httpMethod - resources.applications.resources.deviceTierConfigs.methods.list.id - resources.applications.resources.deviceTierConfigs.methods.list.parameterOrder - resources.applications.resources.deviceTierConfigs.methods.list.parameters.packageName.description - resources.applications.resources.deviceTierConfigs.methods.list.parameters.packageName.location - resources.applications.resources.deviceTierConfigs.methods.list.parameters.packageName.required - resources.applications.resources.deviceTierConfigs.methods.list.parameters.packageName.type - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageSize.description - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageSize.format - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageSize.location - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageSize.type - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageToken.description - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageToken.location - resources.applications.resources.deviceTierConfigs.methods.list.parameters.pageToken.type - resources.applications.resources.deviceTierConfigs.methods.list.path - resources.applications.resources.deviceTierConfigs.methods.list.response.$ref - resources.applications.resources.deviceTierConfigs.methods.list.scopes - schemas.DeviceGroup.description - schemas.DeviceGroup.id - schemas.DeviceGroup.properties.deviceSelectors.description - schemas.DeviceGroup.properties.deviceSelectors.items.$ref - schemas.DeviceGroup.properties.deviceSelectors.type - schemas.DeviceGroup.properties.name.description - schemas.DeviceGroup.properties.name.type - schemas.DeviceGroup.type - schemas.DeviceId.description - schemas.DeviceId.id - schemas.DeviceId.properties.buildBrand.description - schemas.DeviceId.properties.buildBrand.type - schemas.DeviceId.properties.buildDevice.description - schemas.DeviceId.properties.buildDevice.type - schemas.DeviceId.type - schemas.DeviceRam.description - schemas.DeviceRam.id - schemas.DeviceRam.properties.maxBytes.description - schemas.DeviceRam.properties.maxBytes.format - schemas.DeviceRam.properties.maxBytes.type - schemas.DeviceRam.properties.minBytes.description - schemas.DeviceRam.properties.minBytes.format - schemas.DeviceRam.properties.minBytes.type - schemas.DeviceRam.type - schemas.DeviceSelector.description - schemas.DeviceSelector.id - schemas.DeviceSelector.properties.deviceRam.$ref - schemas.DeviceSelector.properties.deviceRam.description - schemas.DeviceSelector.properties.excludedDeviceIds.description - schemas.DeviceSelector.properties.excludedDeviceIds.items.$ref - schemas.DeviceSelector.properties.excludedDeviceIds.type - schemas.DeviceSelector.properties.forbiddenSystemFeatures.description - schemas.DeviceSelector.properties.forbiddenSystemFeatures.items.$ref - schemas.DeviceSelector.properties.forbiddenSystemFeatures.type - schemas.DeviceSelector.properties.includedDeviceIds.description - schemas.DeviceSelector.properties.includedDeviceIds.items.$ref - schemas.DeviceSelector.properties.includedDeviceIds.type - schemas.DeviceSelector.properties.requiredSystemFeatures.description - schemas.DeviceSelector.properties.requiredSystemFeatures.items.$ref - schemas.DeviceSelector.properties.requiredSystemFeatures.type - schemas.DeviceSelector.type - schemas.DeviceTier.description - schemas.DeviceTier.id - schemas.DeviceTier.properties.deviceGroupNames.description - schemas.DeviceTier.properties.deviceGroupNames.items.type - schemas.DeviceTier.properties.deviceGroupNames.type - schemas.DeviceTier.properties.level.description - schemas.DeviceTier.properties.level.format - schemas.DeviceTier.properties.level.type - schemas.DeviceTier.type - schemas.DeviceTierConfig.description - schemas.DeviceTierConfig.id - schemas.DeviceTierConfig.properties.deviceGroups.description - schemas.DeviceTierConfig.properties.deviceGroups.items.$ref - schemas.DeviceTierConfig.properties.deviceGroups.type - schemas.DeviceTierConfig.properties.deviceTierConfigId.description - schemas.DeviceTierConfig.properties.deviceTierConfigId.format - schemas.DeviceTierConfig.properties.deviceTierConfigId.readOnly - schemas.DeviceTierConfig.properties.deviceTierConfigId.type - schemas.DeviceTierConfig.properties.deviceTierSet.$ref - schemas.DeviceTierConfig.properties.deviceTierSet.description - schemas.DeviceTierConfig.type - schemas.DeviceTierSet.description - schemas.DeviceTierSet.id - schemas.DeviceTierSet.properties.deviceTiers.description - schemas.DeviceTierSet.properties.deviceTiers.items.$ref - schemas.DeviceTierSet.properties.deviceTiers.type - schemas.DeviceTierSet.type - schemas.ListDeviceTierConfigsResponse.description - schemas.ListDeviceTierConfigsResponse.id - schemas.ListDeviceTierConfigsResponse.properties.deviceTierConfigs.description - schemas.ListDeviceTierConfigsResponse.properties.deviceTierConfigs.items.$ref - schemas.ListDeviceTierConfigsResponse.properties.deviceTierConfigs.type - schemas.ListDeviceTierConfigsResponse.properties.nextPageToken.description - schemas.ListDeviceTierConfigsResponse.properties.nextPageToken.type - schemas.ListDeviceTierConfigsResponse.type - schemas.SystemFeature.description - schemas.SystemFeature.id - schemas.SystemFeature.properties.name.description - schemas.SystemFeature.properties.name.type - schemas.SystemFeature.type --- discovery/androidpublisher-v3.json | 284 +++++++++++++- src/apis/androidpublisher/v3.ts | 610 +++++++++++++++++++++++++++++ 2 files changed, 893 insertions(+), 1 deletion(-) diff --git a/discovery/androidpublisher-v3.json b/discovery/androidpublisher-v3.json index fd9bdc6217..92dd6dbd1d 100644 --- a/discovery/androidpublisher-v3.json +++ b/discovery/androidpublisher-v3.json @@ -104,6 +104,113 @@ }, "protocol": "rest", "resources": { + "applications": { + "resources": { + "deviceTierConfigs": { + "methods": { + "create": { + "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" + ] + }, + "get": { + "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" + ] + }, + "list": { + "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" + ] + } + } + } + } + }, "edits": { "methods": { "commit": { @@ -3040,7 +3147,7 @@ } } }, - "revision": "20220322", + "revision": "20220330", "rootUrl": "https://androidpublisher.googleapis.com/", "schemas": { "Apk": { @@ -3335,6 +3442,39 @@ }, "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", + "properties": { + "deviceSelectors": { + "description": "Device selectors for this group. A device matching any of the selectors is included in this group.", + "items": { + "$ref": "DeviceSelector" + }, + "type": "array" + }, + "name": { + "description": "The name of the group.", + "type": "string" + } + }, + "type": "object" + }, + "DeviceId": { + "description": "Identifier of a device.", + "id": "DeviceId", + "properties": { + "buildBrand": { + "description": "Value of Build.BRAND.", + "type": "string" + }, + "buildDevice": { + "description": "Value of Build.DEVICE.", + "type": "string" + } + }, + "type": "object" + }, "DeviceMetadata": { "description": "Characteristics of the user's device.", "id": "DeviceMetadata", @@ -3391,6 +3531,62 @@ }, "type": "object" }, + "DeviceRam": { + "description": "Conditions about a device's RAM capabilities.", + "id": "DeviceRam", + "properties": { + "maxBytes": { + "description": "Maximum RAM in bytes (bound excluded).", + "format": "int64", + "type": "string" + }, + "minBytes": { + "description": "Minimum RAM in bytes (bound included).", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "DeviceSelector": { + "description": "Selector for a device group. A selector consists of a set of conditions on the device that should all match (logical AND) to determine a device group eligibility. For instance, if a selector specifies RAM conditions, device model inclusion and device model exclusion, a device is considered to match if: device matches RAM conditions AND device matches one of the included device models AND device doesn't match excluded device models", + "id": "DeviceSelector", + "properties": { + "deviceRam": { + "$ref": "DeviceRam", + "description": "Conditions on the device's RAM." + }, + "excludedDeviceIds": { + "description": "Device models excluded by this selector, even if they match all other conditions.", + "items": { + "$ref": "DeviceId" + }, + "type": "array" + }, + "forbiddenSystemFeatures": { + "description": "A device that has any of these system features is excluded by this selector, even if it matches all other conditions.", + "items": { + "$ref": "SystemFeature" + }, + "type": "array" + }, + "includedDeviceIds": { + "description": "Device models included by this selector.", + "items": { + "$ref": "DeviceId" + }, + "type": "array" + }, + "requiredSystemFeatures": { + "description": "A device needs to have all these system features to be included by the selector.", + "items": { + "$ref": "SystemFeature" + }, + "type": "array" + } + }, + "type": "object" + }, "DeviceSpec": { "description": "The device spec used to generate a system APK.", "id": "DeviceSpec", @@ -3417,6 +3613,63 @@ }, "type": "object" }, + "DeviceTier": { + "description": "A single device tier. Devices matching any of the device groups in device_group_names are considered to match the tier.", + "id": "DeviceTier", + "properties": { + "deviceGroupNames": { + "description": "Groups of devices included in this tier. These groups must be defined explicitly under device_groups in this configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "level": { + "description": "The priority level of the tier. Tiers are evaluated in descending order of level: the highest level tier has the highest priority. The highest tier matching a given device is selected for that device. You should use a contiguous range of levels for your tiers in a tier set; tier levels in a tier set must be unique. For instance, if your tier set has 4 tiers (including the global fallback), you should define tiers 1, 2 and 3 in this configuration. Note: tier 0 is implicitly defined as a global fallback and selected for devices that don't match any of the tiers explicitly defined here. You mustn't define level 0 explicitly in this configuration.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "DeviceTierConfig": { + "description": "LINT.IfChange Configuration describing device targeting criteria for the content of an app.", + "id": "DeviceTierConfig", + "properties": { + "deviceGroups": { + "description": "Definition of device groups for the app.", + "items": { + "$ref": "DeviceGroup" + }, + "type": "array" + }, + "deviceTierConfigId": { + "description": "Output only. The device tier config ID.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "deviceTierSet": { + "$ref": "DeviceTierSet", + "description": "Definition of the set of device tiers for the app." + } + }, + "type": "object" + }, + "DeviceTierSet": { + "description": "A set of device tiers. A tier set determines what variation of app content gets served to a specific device, for device-targeted content. You should assign a priority level to each tier, which determines the ordering by which they are evaluated by Play. See the documentation of DeviceTier.level for more details.", + "id": "DeviceTierSet", + "properties": { + "deviceTiers": { + "description": "Device tiers belonging to the set.", + "items": { + "$ref": "DeviceTier" + }, + "type": "array" + } + }, + "type": "object" + }, "ExpansionFile": { "description": "An expansion file. The resource for ExpansionFilesService.", "id": "ExpansionFile", @@ -3940,6 +4193,24 @@ }, "type": "object" }, + "ListDeviceTierConfigsResponse": { + "description": "Response listing existing device tier configs.", + "id": "ListDeviceTierConfigsResponse", + "properties": { + "deviceTierConfigs": { + "description": "Device tier configs created by the developer.", + "items": { + "$ref": "DeviceTierConfig" + }, + "type": "array" + }, + "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" + } + }, + "type": "object" + }, "ListUsersResponse": { "description": "A response containing one or more users with access to an account.", "id": "ListUsersResponse", @@ -4554,6 +4825,17 @@ }, "type": "object" }, + "SystemFeature": { + "description": "Representation of a system feature.", + "id": "SystemFeature", + "properties": { + "name": { + "description": "The name of the feature.", + "type": "string" + } + }, + "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", diff --git a/src/apis/androidpublisher/v3.ts b/src/apis/androidpublisher/v3.ts index bed218319c..2c27729dbc 100644 --- a/src/apis/androidpublisher/v3.ts +++ b/src/apis/androidpublisher/v3.ts @@ -113,6 +113,7 @@ export namespace androidpublisher_v3 { */ export class Androidpublisher { context: APIRequestContext; + applications: Resource$Applications; edits: Resource$Edits; generatedapks: Resource$Generatedapks; grants: Resource$Grants; @@ -131,6 +132,7 @@ export namespace androidpublisher_v3 { google, }; + this.applications = new Resource$Applications(this.context); this.edits = new Resource$Edits(this.context); this.generatedapks = new Resource$Generatedapks(this.context); this.grants = new Resource$Grants(this.context); @@ -376,6 +378,32 @@ export namespace androidpublisher_v3 { */ text?: string | null; } + /** + * 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). + */ + export interface Schema$DeviceGroup { + /** + * Device selectors for this group. A device matching any of the selectors is included in this group. + */ + deviceSelectors?: Schema$DeviceSelector[]; + /** + * The name of the group. + */ + name?: string | null; + } + /** + * Identifier of a device. + */ + export interface Schema$DeviceId { + /** + * Value of Build.BRAND. + */ + buildBrand?: string | null; + /** + * Value of Build.DEVICE. + */ + buildDevice?: string | null; + } /** * Characteristics of the user's device. */ @@ -425,6 +453,44 @@ export namespace androidpublisher_v3 { */ screenWidthPx?: number | null; } + /** + * Conditions about a device's RAM capabilities. + */ + export interface Schema$DeviceRam { + /** + * Maximum RAM in bytes (bound excluded). + */ + maxBytes?: string | null; + /** + * Minimum RAM in bytes (bound included). + */ + minBytes?: string | null; + } + /** + * Selector for a device group. A selector consists of a set of conditions on the device that should all match (logical AND) to determine a device group eligibility. For instance, if a selector specifies RAM conditions, device model inclusion and device model exclusion, a device is considered to match if: device matches RAM conditions AND device matches one of the included device models AND device doesn't match excluded device models + */ + export interface Schema$DeviceSelector { + /** + * Conditions on the device's RAM. + */ + deviceRam?: Schema$DeviceRam; + /** + * Device models excluded by this selector, even if they match all other conditions. + */ + excludedDeviceIds?: Schema$DeviceId[]; + /** + * A device that has any of these system features is excluded by this selector, even if it matches all other conditions. + */ + forbiddenSystemFeatures?: Schema$SystemFeature[]; + /** + * Device models included by this selector. + */ + includedDeviceIds?: Schema$DeviceId[]; + /** + * A device needs to have all these system features to be included by the selector. + */ + requiredSystemFeatures?: Schema$SystemFeature[]; + } /** * The device spec used to generate a system APK. */ @@ -442,6 +508,45 @@ export namespace androidpublisher_v3 { */ supportedLocales?: string[] | null; } + /** + * A single device tier. Devices matching any of the device groups in device_group_names are considered to match the tier. + */ + export interface Schema$DeviceTier { + /** + * Groups of devices included in this tier. These groups must be defined explicitly under device_groups in this configuration. + */ + deviceGroupNames?: string[] | null; + /** + * The priority level of the tier. Tiers are evaluated in descending order of level: the highest level tier has the highest priority. The highest tier matching a given device is selected for that device. You should use a contiguous range of levels for your tiers in a tier set; tier levels in a tier set must be unique. For instance, if your tier set has 4 tiers (including the global fallback), you should define tiers 1, 2 and 3 in this configuration. Note: tier 0 is implicitly defined as a global fallback and selected for devices that don't match any of the tiers explicitly defined here. You mustn't define level 0 explicitly in this configuration. + */ + level?: number | null; + } + /** + * LINT.IfChange Configuration describing device targeting criteria for the content of an app. + */ + export interface Schema$DeviceTierConfig { + /** + * Definition of device groups for the app. + */ + deviceGroups?: Schema$DeviceGroup[]; + /** + * Output only. The device tier config ID. + */ + deviceTierConfigId?: string | null; + /** + * Definition of the set of device tiers for the app. + */ + deviceTierSet?: Schema$DeviceTierSet; + } + /** + * A set of device tiers. A tier set determines what variation of app content gets served to a specific device, for device-targeted content. You should assign a priority level to each tier, which determines the ordering by which they are evaluated by Play. See the documentation of DeviceTier.level for more details. + */ + export interface Schema$DeviceTierSet { + /** + * Device tiers belonging to the set. + */ + deviceTiers?: Schema$DeviceTier[]; + } /** * An expansion file. The resource for ExpansionFilesService. */ @@ -825,6 +930,19 @@ export namespace androidpublisher_v3 { */ introductoryPricePeriod?: string | null; } + /** + * Response listing existing device tier configs. + */ + export interface Schema$ListDeviceTierConfigsResponse { + /** + * Device tier configs created by the developer. + */ + deviceTierConfigs?: Schema$DeviceTierConfig[]; + /** + * 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 | null; + } /** * A localized store listing. The resource for ListingsService. */ @@ -1310,6 +1428,15 @@ export namespace androidpublisher_v3 { */ variants?: Schema$Variant[]; } + /** + * Representation of a system feature. + */ + export interface Schema$SystemFeature { + /** + * The name of the feature. + */ + name?: string | null; + } /** * 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. */ @@ -1587,6 +1714,489 @@ export namespace androidpublisher_v3 { voidedPurchases?: Schema$VoidedPurchase[]; } + export class Resource$Applications { + context: APIRequestContext; + deviceTierConfigs: Resource$Applications$Devicetierconfigs; + constructor(context: APIRequestContext) { + this.context = context; + this.deviceTierConfigs = new Resource$Applications$Devicetierconfigs( + this.context + ); + } + } + + export class Resource$Applications$Devicetierconfigs { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * Creates a new device tier config for an app. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const androidpublisher = google.androidpublisher('v3'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/androidpublisher'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await androidpublisher.applications.deviceTierConfigs.create({ + * // Whether the service should accept device IDs that are unknown to Play's device catalog. + * allowUnknownDevices: 'placeholder-value', + * // Package name of the app. + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceGroups": [], + * // "deviceTierConfigId": "my_deviceTierConfigId", + * // "deviceTierSet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceGroups": [], + * // "deviceTierConfigId": "my_deviceTierConfigId", + * // "deviceTierSet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * ``` + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + create( + params: Params$Resource$Applications$Devicetierconfigs$Create, + options: StreamMethodOptions + ): GaxiosPromise; + create( + params?: Params$Resource$Applications$Devicetierconfigs$Create, + options?: MethodOptions + ): GaxiosPromise; + create( + params: Params$Resource$Applications$Devicetierconfigs$Create, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Applications$Devicetierconfigs$Create, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Applications$Devicetierconfigs$Create, + callback: BodyResponseCallback + ): void; + create(callback: BodyResponseCallback): void; + create( + paramsOrCallback?: + | Params$Resource$Applications$Devicetierconfigs$Create + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Applications$Devicetierconfigs$Create; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Applications$Devicetierconfigs$Create; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://androidpublisher.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/androidpublisher/v3/applications/{packageName}/deviceTierConfigs' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Returns a particular device tier config. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const androidpublisher = google.androidpublisher('v3'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/androidpublisher'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await androidpublisher.applications.deviceTierConfigs.get({ + * // Required. Id of an existing device tier config. + * deviceTierConfigId: 'placeholder-value', + * // Package name of the app. + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceGroups": [], + * // "deviceTierConfigId": "my_deviceTierConfigId", + * // "deviceTierSet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * ``` + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + get( + params: Params$Resource$Applications$Devicetierconfigs$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Applications$Devicetierconfigs$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Applications$Devicetierconfigs$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Applications$Devicetierconfigs$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Applications$Devicetierconfigs$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Applications$Devicetierconfigs$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Applications$Devicetierconfigs$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Applications$Devicetierconfigs$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://androidpublisher.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['packageName', 'deviceTierConfigId'], + pathParams: ['deviceTierConfigId', 'packageName'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Returns created device tier configs, ordered by descending creation time. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const androidpublisher = google.androidpublisher('v3'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/androidpublisher'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await androidpublisher.applications.deviceTierConfigs.list({ + * // Package name of the app. + * packageName: 'placeholder-value', + * // 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. + * pageSize: 'placeholder-value', + * // A page token, received from a previous `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceTierConfigs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * ``` + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + list( + params: Params$Resource$Applications$Devicetierconfigs$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Applications$Devicetierconfigs$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Applications$Devicetierconfigs$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Applications$Devicetierconfigs$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Applications$Devicetierconfigs$List, + callback: BodyResponseCallback + ): void; + list( + callback: BodyResponseCallback + ): void; + list( + paramsOrCallback?: + | Params$Resource$Applications$Devicetierconfigs$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Applications$Devicetierconfigs$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Applications$Devicetierconfigs$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://androidpublisher.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/androidpublisher/v3/applications/{packageName}/deviceTierConfigs' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + } + + export interface Params$Resource$Applications$Devicetierconfigs$Create + extends StandardParameters { + /** + * Whether the service should accept device IDs that are unknown to Play's device catalog. + */ + allowUnknownDevices?: boolean; + /** + * Package name of the app. + */ + packageName?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$DeviceTierConfig; + } + export interface Params$Resource$Applications$Devicetierconfigs$Get + extends StandardParameters { + /** + * Required. Id of an existing device tier config. + */ + deviceTierConfigId?: string; + /** + * Package name of the app. + */ + packageName?: string; + } + export interface Params$Resource$Applications$Devicetierconfigs$List + extends StandardParameters { + /** + * Package name of the app. + */ + packageName?: string; + /** + * 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. + */ + pageSize?: number; + /** + * A page token, received from a previous `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page. + */ + pageToken?: string; + } + export class Resource$Edits { context: APIRequestContext; apks: Resource$Edits$Apks;