// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Google Play Android Developer API Client for Deno * ================================================= * * Lets Android application developers access their Google Play accounts. At a high level, the expected workflow is to "insert" an Edit, make changes as necessary, and then "commit" it. * * Docs: https://developers.google.com/android-publisher * Source: https://googleapis.deno.dev/v1/androidpublisher:v3.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Lets Android application developers access their Google Play accounts. At a * high level, the expected workflow is to "insert" an Edit, make changes as * necessary, and then "commit" it. */ export class Androidpublisher { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://androidpublisher.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Writes the Safety Labels declaration of an app. * * @param packageName Required. Package name of the app. */ async applicationsDataSafety(packageName: string, req: SafetyLabelsUpdateRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/dataSafety`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as SafetyLabelsUpdateResponse; } /** * Creates a new device tier config for an app. * * @param packageName Package name of the app. */ async applicationsDeviceTierConfigsCreate(packageName: string, req: DeviceTierConfig, opts: ApplicationsDeviceTierConfigsCreateOptions = {}): Promise { req = serializeDeviceTierConfig(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/deviceTierConfigs`); if (opts.allowUnknownDevices !== undefined) { url.searchParams.append("allowUnknownDevices", String(opts.allowUnknownDevices)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeDeviceTierConfig(data); } /** * Returns a particular device tier config. * * @param deviceTierConfigId Required. Id of an existing device tier config. * @param packageName Package name of the app. */ async applicationsDeviceTierConfigsGet(deviceTierConfigId: bigint, packageName: string): Promise { deviceTierConfigId = String(deviceTierConfigId); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/deviceTierConfigs/${ deviceTierConfigId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDeviceTierConfig(data); } /** * Returns created device tier configs, ordered by descending creation time. * * @param packageName Package name of the app. */ async applicationsDeviceTierConfigsList(packageName: string, opts: ApplicationsDeviceTierConfigsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/deviceTierConfigs`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListDeviceTierConfigsResponse(data); } /** * Incrementally update targeting for a recovery action. Note that only the * criteria selected during the creation of recovery action can be expanded. * * @param appRecoveryId Required. ID corresponding to the app recovery action. * @param packageName Required. Package name of the app for which recovery action is to be updated. */ async apprecoveryAddTargeting(appRecoveryId: bigint, packageName: string, req: AddTargetingRequest): Promise { appRecoveryId = String(appRecoveryId); req = serializeAddTargetingRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/appRecoveries/${ appRecoveryId }:addTargeting`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as AddTargetingResponse; } /** * Cancel an already executing app recovery action. Note that this action * changes status of the recovery action to CANCELED. * * @param appRecoveryId Required. ID corresponding to the app recovery action. * @param packageName Required. Package name of the app for which recovery action cancellation is requested. */ async apprecoveryCancel(appRecoveryId: bigint, packageName: string, req: CancelAppRecoveryRequest): Promise { appRecoveryId = String(appRecoveryId); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/appRecoveries/${ appRecoveryId }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CancelAppRecoveryResponse; } /** * Create an app recovery action with recovery status as DRAFT. Note that * this action does not execute the recovery action. * * @param packageName Required. Package name of the app on which recovery action is performed. */ async apprecoveryCreate(packageName: string, req: CreateDraftAppRecoveryRequest): Promise { req = serializeCreateDraftAppRecoveryRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/appRecoveries`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeAppRecoveryAction(data); } /** * Deploy an already created app recovery action with recovery status DRAFT. * Note that this action activates the recovery action for all targeted users * and changes its status to ACTIVE. * * @param appRecoveryId Required. ID corresponding to the app recovery action to deploy. * @param packageName Required. Package name of the app for which recovery action is deployed. */ async apprecoveryDeploy(appRecoveryId: bigint, packageName: string, req: DeployAppRecoveryRequest): Promise { appRecoveryId = String(appRecoveryId); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/appRecoveries/${ appRecoveryId }:deploy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as DeployAppRecoveryResponse; } /** * List all app recovery action resources associated with a particular * package name and app version. * * @param packageName Required. Package name of the app for which list of recovery actions is requested. */ async apprecoveryList(packageName: string, opts: ApprecoveryListOptions = {}): Promise { opts = serializeApprecoveryListOptions(opts); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/appRecoveries`); if (opts.versionCode !== undefined) { url.searchParams.append("versionCode", String(opts.versionCode)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListAppRecoveriesResponse(data); } /** * 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. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsApksAddexternallyhosted(editId: string, packageName: string, req: ApksAddExternallyHostedRequest): Promise { req = serializeApksAddExternallyHostedRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks/externallyHosted`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeApksAddExternallyHostedResponse(data); } /** * Lists all current APKs of the app and edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsApksList(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ApksListResponse; } /** * Uploads an APK and adds to the current edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsApksUpload(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks`); const data = await request(url.href, { client: this.#client, method: "POST", }); return data as Apk; } /** * Lists all current Android App Bundles of the app and edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsBundlesList(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/bundles`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as BundlesListResponse; } /** * 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. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsBundlesUpload(editId: string, packageName: string, opts: EditsBundlesUploadOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/bundles`); if (opts.ackBundleInstallationWarning !== undefined) { url.searchParams.append("ackBundleInstallationWarning", String(opts.ackBundleInstallationWarning)); } if (opts.deviceTierConfigId !== undefined) { url.searchParams.append("deviceTierConfigId", String(opts.deviceTierConfigId)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return data as Bundle; } /** * Commits an app edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsCommit(editId: string, packageName: string, opts: EditsCommitOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }:commit`); if (opts.changesNotSentForReview !== undefined) { url.searchParams.append("changesNotSentForReview", String(opts.changesNotSentForReview)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return data as AppEdit; } /** * Gets country availability. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track The track to read from. */ async editsCountryavailabilityGet(editId: string, packageName: string, track: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/countryAvailability/${ track }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as TrackCountryAvailability; } /** * Deletes an app edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsDelete(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Uploads a new deobfuscation file and attaches to the specified APK. * * @param apkVersionCode The version code of the APK whose Deobfuscation File is being uploaded. * @param deobfuscationFileType The type of the deobfuscation file. * @param editId Unique identifier for this edit. * @param packageName Unique identifier for the Android app. */ async editsDeobfuscationfilesUpload(apkVersionCode: number, deobfuscationFileType: | "deobfuscationFileTypeUnspecified" | "proguard" | "nativeCode", editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks/${ apkVersionCode }/deobfuscationFiles/${ deobfuscationFileType }`); const data = await request(url.href, { client: this.#client, method: "POST", }); return data as DeobfuscationFilesUploadResponse; } /** * Gets details of an app. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsDetailsGet(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/details`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as AppDetails; } /** * Patches details of an app. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsDetailsPatch(editId: string, packageName: string, req: AppDetails): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/details`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as AppDetails; } /** * Updates details of an app. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsDetailsUpdate(editId: string, packageName: string, req: AppDetails): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/details`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as AppDetails; } /** * Fetches the expansion file configuration for the specified APK. * * @param apkVersionCode The version code of the APK whose expansion file configuration is being read or modified. * @param editId Identifier of the edit. * @param expansionFileType The file type of the file configuration which is being read or modified. * @param packageName Package name of the app. */ async editsExpansionfilesGet(apkVersionCode: number, editId: string, expansionFileType: | "expansionFileTypeUnspecified" | "main" | "patch", packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks/${ apkVersionCode }/expansionFiles/${ expansionFileType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeExpansionFile(data); } /** * Patches the APK's expansion file configuration to reference another APK's * expansion file. To add a new expansion file use the Upload method. * * @param apkVersionCode The version code of the APK whose expansion file configuration is being read or modified. * @param editId Identifier of the edit. * @param expansionFileType The file type of the expansion file configuration which is being updated. * @param packageName Package name of the app. */ async editsExpansionfilesPatch(apkVersionCode: number, editId: string, expansionFileType: | "expansionFileTypeUnspecified" | "main" | "patch", packageName: string, req: ExpansionFile): Promise { req = serializeExpansionFile(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks/${ apkVersionCode }/expansionFiles/${ expansionFileType }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeExpansionFile(data); } /** * Updates the APK's expansion file configuration to reference another APK's * expansion file. To add a new expansion file use the Upload method. * * @param apkVersionCode The version code of the APK whose expansion file configuration is being read or modified. * @param editId Identifier of the edit. * @param expansionFileType The file type of the file configuration which is being read or modified. * @param packageName Package name of the app. */ async editsExpansionfilesUpdate(apkVersionCode: number, editId: string, expansionFileType: | "expansionFileTypeUnspecified" | "main" | "patch", packageName: string, req: ExpansionFile): Promise { req = serializeExpansionFile(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks/${ apkVersionCode }/expansionFiles/${ expansionFileType }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeExpansionFile(data); } /** * Uploads a new expansion file and attaches to the specified APK. * * @param apkVersionCode The version code of the APK whose expansion file configuration is being read or modified. * @param editId Identifier of the edit. * @param expansionFileType The file type of the expansion file configuration which is being updated. * @param packageName Package name of the app. */ async editsExpansionfilesUpload(apkVersionCode: number, editId: string, expansionFileType: | "expansionFileTypeUnspecified" | "main" | "patch", packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/apks/${ apkVersionCode }/expansionFiles/${ expansionFileType }`); const data = await request(url.href, { client: this.#client, method: "POST", }); return deserializeExpansionFilesUploadResponse(data); } /** * Gets an app edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsGet(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as AppEdit; } /** * Deletes the image (specified by id) from the edit. * * @param editId Identifier of the edit. * @param imageId Unique identifier an image within the set of images attached to this edit. * @param imageType Type of the Image. * @param language Language localization code (a BCP-47 language tag; for example, "de-AT" for Austrian German). * @param packageName Package name of the app. */ async editsImagesDelete(editId: string, imageId: string, imageType: | "appImageTypeUnspecified" | "phoneScreenshots" | "sevenInchScreenshots" | "tenInchScreenshots" | "tvScreenshots" | "wearScreenshots" | "icon" | "featureGraphic" | "tvBanner", language: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }/${ imageType }/${ imageId }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Deletes all images for the specified language and image type. Returns an * empty response if no images are found. * * @param editId Identifier of the edit. * @param imageType Type of the Image. Providing an image type that refers to no images is a no-op. * @param 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. * @param packageName Package name of the app. */ async editsImagesDeleteall(editId: string, imageType: | "appImageTypeUnspecified" | "phoneScreenshots" | "sevenInchScreenshots" | "tenInchScreenshots" | "tvScreenshots" | "wearScreenshots" | "icon" | "featureGraphic" | "tvBanner", language: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }/${ imageType }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as ImagesDeleteAllResponse; } /** * Lists all images. The response may be empty. * * @param editId Identifier of the edit. * @param imageType Type of the Image. Providing an image type that refers to no images will return an empty response. * @param 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. * @param packageName Package name of the app. */ async editsImagesList(editId: string, imageType: | "appImageTypeUnspecified" | "phoneScreenshots" | "sevenInchScreenshots" | "tenInchScreenshots" | "tvScreenshots" | "wearScreenshots" | "icon" | "featureGraphic" | "tvBanner", language: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }/${ imageType }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ImagesListResponse; } /** * Uploads an image of the specified language and image type, and adds to the * edit. * * @param editId Identifier of the edit. * @param imageType Type of the Image. * @param 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. * @param packageName Package name of the app. */ async editsImagesUpload(editId: string, imageType: | "appImageTypeUnspecified" | "phoneScreenshots" | "sevenInchScreenshots" | "tenInchScreenshots" | "tvScreenshots" | "wearScreenshots" | "icon" | "featureGraphic" | "tvBanner", language: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }/${ imageType }`); const data = await request(url.href, { client: this.#client, method: "POST", }); return data as ImagesUploadResponse; } /** * Creates a new edit for an app. * * @param packageName Package name of the app. */ async editsInsert(packageName: string, req: AppEdit): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as AppEdit; } /** * Deletes a localized store listing. * * @param editId Identifier of the edit. * @param language Language localization code (a BCP-47 language tag; for example, "de-AT" for Austrian German). * @param packageName Package name of the app. */ async editsListingsDelete(editId: string, language: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Deletes all store listings. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsListingsDeleteall(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Gets a localized store listing. * * @param editId Identifier of the edit. * @param language Language localization code (a BCP-47 language tag; for example, "de-AT" for Austrian German). * @param packageName Package name of the app. */ async editsListingsGet(editId: string, language: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Listing; } /** * Lists all localized store listings. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsListingsList(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListingsListResponse; } /** * Patches a localized store listing. * * @param editId Identifier of the edit. * @param language Language localization code (a BCP-47 language tag; for example, "de-AT" for Austrian German). * @param packageName Package name of the app. */ async editsListingsPatch(editId: string, language: string, packageName: string, req: Listing): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Listing; } /** * Creates or updates a localized store listing. * * @param editId Identifier of the edit. * @param language Language localization code (a BCP-47 language tag; for example, "de-AT" for Austrian German). * @param packageName Package name of the app. */ async editsListingsUpdate(editId: string, language: string, packageName: string, req: Listing): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/listings/${ language }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as Listing; } /** * Gets testers. Note: Testers resource does not support email lists. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track The track to read from. */ async editsTestersGet(editId: string, packageName: string, track: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/testers/${ track }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Testers; } /** * Patches testers. Note: Testers resource does not support email lists. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track The track to update. */ async editsTestersPatch(editId: string, packageName: string, track: string, req: Testers): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/testers/${ track }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Testers; } /** * Updates testers. Note: Testers resource does not support email lists. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track The track to update. */ async editsTestersUpdate(editId: string, packageName: string, track: string, req: Testers): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/testers/${ track }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as Testers; } /** * Creates a new track. * * @param editId Required. Identifier of the edit. * @param packageName Required. Package name of the app. */ async editsTracksCreate(editId: string, packageName: string, req: TrackConfig): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/tracks`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeTrack(data); } /** * Gets a track. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name) */ async editsTracksGet(editId: string, packageName: string, track: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/tracks/${ track }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTrack(data); } /** * Lists all tracks. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsTracksList(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/tracks`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTracksListResponse(data); } /** * Patches a track. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name) */ async editsTracksPatch(editId: string, packageName: string, track: string, req: Track): Promise { req = serializeTrack(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/tracks/${ track }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeTrack(data); } /** * Updates a track. * * @param editId Identifier of the edit. * @param packageName Package name of the app. * @param track Identifier of the track. [More on track name](https://developers.google.com/android-publisher/tracks#ff-track-name) */ async editsTracksUpdate(editId: string, packageName: string, track: string, req: Track): Promise { req = serializeTrack(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }/tracks/${ track }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeTrack(data); } /** * Validates an app edit. * * @param editId Identifier of the edit. * @param packageName Package name of the app. */ async editsValidate(editId: string, packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/edits/${ editId }:validate`); const data = await request(url.href, { client: this.#client, method: "POST", }); return data as AppEdit; } /** * Creates a new external transaction. * * @param parent Required. The parent resource where this external transaction will be created. Format: applications/{package_name} */ async externaltransactionsCreateexternaltransaction(parent: string, req: ExternalTransaction, opts: ExternaltransactionsCreateexternaltransactionOptions = {}): Promise { req = serializeExternalTransaction(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ parent }/externalTransactions`); if (opts.externalTransactionId !== undefined) { url.searchParams.append("externalTransactionId", String(opts.externalTransactionId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeExternalTransaction(data); } /** * Gets an existing external transaction. * * @param name Required. The name of the external transaction to retrieve. Format: applications/{package_name}/externalTransactions/{external_transaction} */ async externaltransactionsGetexternaltransaction(name: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeExternalTransaction(data); } /** * Refunds or partially refunds an existing external transaction. * * @param name Required. The name of the external transaction that will be refunded. Format: applications/{package_name}/externalTransactions/{external_transaction} */ async externaltransactionsRefundexternaltransaction(name: string, req: RefundExternalTransactionRequest): Promise { req = serializeRefundExternalTransactionRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ name }:refund`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeExternalTransaction(data); } /** * Downloads a single signed APK generated from an app bundle. * * @param downloadId Download ID, which uniquely identifies the APK to download. Can be obtained from the response of `generatedapks.list` method. * @param packageName Package name of the app. * @param versionCode Version code of the app bundle. */ async generatedapksDownload(downloadId: string, packageName: string, versionCode: number): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/generatedApks/${ versionCode }/downloads/${ downloadId }:download`); const data = await request(url.href, { client: this.#client, method: "GET", }); } /** * Returns download metadata for all APKs that were generated from a given * app bundle. * * @param packageName Package name of the app. * @param versionCode Version code of the app bundle. */ async generatedapksList(packageName: string, versionCode: number): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/generatedApks/${ versionCode }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGeneratedApksListResponse(data); } /** * Grant access for a user to the given package. * * @param parent Required. The user which needs permission. Format: developers/{developer}/users/{user} */ async grantsCreate(parent: string, req: Grant): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ parent }/grants`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Grant; } /** * Removes all access for the user to the given package or developer account. * * @param name Required. The name of the grant to delete. Format: developers/{developer}/users/{email}/grants/{package_name} */ async grantsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Updates access for the user to the given package. * * @param name 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. */ async grantsPatch(name: string, req: Grant, opts: GrantsPatchOptions = {}): Promise { opts = serializeGrantsPatchOptions(opts); const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Grant; } /** * Deletes in-app products (managed products or subscriptions). Set the * latencyTolerance field on nested requests to * PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update * throughput. This method should not be used to delete subscriptions. See * [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. */ async inappproductsBatchDelete(packageName: string, req: InappproductsBatchDeleteRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts:batchDelete`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); } /** * Reads multiple in-app products, which can be managed products or * subscriptions. This method should not be used to retrieve subscriptions. * See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. */ async inappproductsBatchGet(packageName: string, opts: InappproductsBatchGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts:batchGet`); if (opts.sku !== undefined) { url.searchParams.append("sku", String(opts.sku)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InappproductsBatchGetResponse; } /** * Updates or inserts one or more in-app products (managed products or * subscriptions). Set the latencyTolerance field on nested requests to * PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update * throughput. This method should no longer be used to update subscriptions. * See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. */ async inappproductsBatchUpdate(packageName: string, req: InappproductsBatchUpdateRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts:batchUpdate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as InappproductsBatchUpdateResponse; } /** * Deletes an in-app product (a managed product or a subscription). This * method should no longer be used to delete subscriptions. See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. * @param sku Unique identifier for the in-app product. */ async inappproductsDelete(packageName: string, sku: string, opts: InappproductsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts/${ sku }`); if (opts.latencyTolerance !== undefined) { url.searchParams.append("latencyTolerance", String(opts.latencyTolerance)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Gets an in-app product, which can be a managed product or a subscription. * This method should no longer be used to retrieve subscriptions. See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. * @param sku Unique identifier for the in-app product. */ async inappproductsGet(packageName: string, sku: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts/${ sku }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InAppProduct; } /** * Creates an in-app product (a managed product or a subscription). This * method should no longer be used to create subscriptions. See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. */ async inappproductsInsert(packageName: string, req: InAppProduct, opts: InappproductsInsertOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts`); if (opts.autoConvertMissingPrices !== undefined) { url.searchParams.append("autoConvertMissingPrices", String(opts.autoConvertMissingPrices)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as InAppProduct; } /** * 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. This method should no longer be used to retrieve * subscriptions. See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. */ async inappproductsList(packageName: string, opts: InappproductsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts`); if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.startIndex !== undefined) { url.searchParams.append("startIndex", String(opts.startIndex)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as InappproductsListResponse; } /** * Patches an in-app product (a managed product or a subscription). This * method should no longer be used to update subscriptions. See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. * @param sku Unique identifier for the in-app product. */ async inappproductsPatch(packageName: string, sku: string, req: InAppProduct, opts: InappproductsPatchOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts/${ sku }`); if (opts.autoConvertMissingPrices !== undefined) { url.searchParams.append("autoConvertMissingPrices", String(opts.autoConvertMissingPrices)); } if (opts.latencyTolerance !== undefined) { url.searchParams.append("latencyTolerance", String(opts.latencyTolerance)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as InAppProduct; } /** * Updates an in-app product (a managed product or a subscription). This * method should no longer be used to update subscriptions. See [this * article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) * for more information. * * @param packageName Package name of the app. * @param sku Unique identifier for the in-app product. */ async inappproductsUpdate(packageName: string, sku: string, req: InAppProduct, opts: InappproductsUpdateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/inappproducts/${ sku }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } if (opts.autoConvertMissingPrices !== undefined) { url.searchParams.append("autoConvertMissingPrices", String(opts.autoConvertMissingPrices)); } if (opts.latencyTolerance !== undefined) { url.searchParams.append("latencyTolerance", String(opts.latencyTolerance)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as InAppProduct; } /** * 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. * * @param packageName Package name of the app. */ async internalappsharingartifactsUploadapk(packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/internalappsharing/${ packageName }/artifacts/apk`); const data = await request(url.href, { client: this.#client, method: "POST", }); return data as InternalAppSharingArtifact; } /** * 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. * * @param packageName Package name of the app. */ async internalappsharingartifactsUploadbundle(packageName: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/internalappsharing/${ packageName }/artifacts/bundle`); const data = await request(url.href, { client: this.#client, method: "POST", }); return data as InternalAppSharingArtifact; } /** * 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. * * @param packageName Required. The app package name. */ async monetizationConvertRegionPrices(packageName: string, req: ConvertRegionPricesRequest): Promise { req = serializeConvertRegionPricesRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/pricing:convertRegionPrices`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeConvertRegionPricesResponse(data); } /** * Deprecated: subscription archiving is not supported. * * @param packageName Required. The parent app (package name) of the app of the subscription to delete. * @param productId Required. The unique product ID of the subscription to delete. */ async monetizationSubscriptionsArchive(packageName: string, productId: string, req: ArchiveSubscriptionRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }:archive`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscription(data); } /** * Activates a base plan. Once activated, base plans will be available to new * subscribers. * * @param basePlanId Required. The unique base plan ID of the base plan to activate. * @param packageName Required. The parent app (package name) of the base plan to activate. * @param productId Required. The parent subscription (ID) of the base plan to activate. */ async monetizationSubscriptionsBasePlansActivate(basePlanId: string, packageName: string, productId: string, req: ActivateBasePlanRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }:activate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscription(data); } /** * Batch variant of the MigrateBasePlanPrices endpoint. Set the * latencyTolerance field on nested requests to * PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update * throughput. * * @param packageName Required. The parent app (package name) for which the subscriptions should be created or updated. Must be equal to the package_name field on all the Subscription resources. * @param productId Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this batch update spans multiple subscriptions, set this field to "-". Must be set. */ async monetizationSubscriptionsBasePlansBatchMigratePrices(packageName: string, productId: string, req: BatchMigrateBasePlanPricesRequest): Promise { req = serializeBatchMigrateBasePlanPricesRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans:batchMigratePrices`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as BatchMigrateBasePlanPricesResponse; } /** * Activates or deactivates base plans across one or multiple subscriptions. * Set the latencyTolerance field on nested requests to * PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update * throughput. * * @param packageName Required. The parent app (package name) of the updated base plans. * @param productId Required. The product ID of the parent subscription, if all updated base plans belong to the same subscription. If this batch update spans multiple subscriptions, set this field to "-". Must be set. */ async monetizationSubscriptionsBasePlansBatchUpdateStates(packageName: string, productId: string, req: BatchUpdateBasePlanStatesRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans:batchUpdateStates`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeBatchUpdateBasePlanStatesResponse(data); } /** * Deactivates a base plan. Once deactivated, the base plan will become * unavailable to new subscribers, but existing subscribers will maintain * their subscription * * @param basePlanId Required. The unique base plan ID of the base plan to deactivate. * @param packageName Required. The parent app (package name) of the base plan to deactivate. * @param productId Required. The parent subscription (ID) of the base plan to deactivate. */ async monetizationSubscriptionsBasePlansDeactivate(basePlanId: string, packageName: string, productId: string, req: DeactivateBasePlanRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }:deactivate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscription(data); } /** * Deletes a base plan. Can only be done for draft base plans. This action is * irreversible. * * @param basePlanId Required. The unique offer ID of the base plan to delete. * @param packageName Required. The parent app (package name) of the base plan to delete. * @param productId Required. The parent subscription (ID) of the base plan to delete. */ async monetizationSubscriptionsBasePlansDelete(basePlanId: string, packageName: string, productId: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Migrates subscribers from one or more legacy price cohorts to the current * price. Requests result in Google Play notifying affected subscribers. Only * up to 250 simultaneous legacy price cohorts are supported. * * @param basePlanId Required. The unique base plan ID of the base plan to update prices on. * @param packageName Required. Package name of the parent app. Must be equal to the package_name field on the Subscription resource. * @param productId Required. The ID of the subscription to update. Must be equal to the product_id field on the Subscription resource. */ async monetizationSubscriptionsBasePlansMigratePrices(basePlanId: string, packageName: string, productId: string, req: MigrateBasePlanPricesRequest): Promise { req = serializeMigrateBasePlanPricesRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }:migratePrices`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as MigrateBasePlanPricesResponse; } /** * Activates a subscription offer. Once activated, subscription offers will * be available to new subscribers. * * @param basePlanId Required. The parent base plan (ID) of the offer to activate. * @param offerId Required. The unique offer ID of the offer to activate. * @param packageName Required. The parent app (package name) of the offer to activate. * @param productId Required. The parent subscription (ID) of the offer to activate. */ async monetizationSubscriptionsBasePlansOffersActivate(basePlanId: string, offerId: string, packageName: string, productId: string, req: ActivateSubscriptionOfferRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers/${ offerId }:activate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscriptionOffer(data); } /** * Reads one or more subscription offers. * * @param basePlanId Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read offers from multiple base plans. * @param packageName Required. The parent app (package name) for which the subscriptions should be created or updated. Must be equal to the package_name field on all the requests. * @param productId Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to "-". Must be set. */ async monetizationSubscriptionsBasePlansOffersBatchGet(basePlanId: string, packageName: string, productId: string, req: BatchGetSubscriptionOffersRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers:batchGet`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeBatchGetSubscriptionOffersResponse(data); } /** * Updates a batch of subscription offers. Set the latencyTolerance field on * nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to * achieve maximum update throughput. * * @param basePlanId Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans. * @param packageName Required. The parent app (package name) of the updated subscription offers. Must be equal to the package_name field on all the updated SubscriptionOffer resources. * @param productId Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to "-". Must be set. */ async monetizationSubscriptionsBasePlansOffersBatchUpdate(basePlanId: string, packageName: string, productId: string, req: BatchUpdateSubscriptionOffersRequest): Promise { req = serializeBatchUpdateSubscriptionOffersRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers:batchUpdate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeBatchUpdateSubscriptionOffersResponse(data); } /** * Updates a batch of subscription offer states. Set the latencyTolerance * field on nested requests to * PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update * throughput. * * @param basePlanId Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans. * @param packageName Required. The parent app (package name) of the updated subscription offers. Must be equal to the package_name field on all the updated SubscriptionOffer resources. * @param productId Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to "-". Must be set. */ async monetizationSubscriptionsBasePlansOffersBatchUpdateStates(basePlanId: string, packageName: string, productId: string, req: BatchUpdateSubscriptionOfferStatesRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers:batchUpdateStates`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeBatchUpdateSubscriptionOfferStatesResponse(data); } /** * Creates a new subscription offer. Only auto-renewing base plans can have * subscription offers. The offer state will be DRAFT until it is activated. * * @param basePlanId 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. * @param packageName 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. * @param productId Required. The parent subscription (ID) for which the offer should be created. Must be equal to the product_id field on the SubscriptionOffer resource. */ async monetizationSubscriptionsBasePlansOffersCreate(basePlanId: string, packageName: string, productId: string, req: SubscriptionOffer, opts: MonetizationSubscriptionsBasePlansOffersCreateOptions = {}): Promise { req = serializeSubscriptionOffer(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers`); if (opts.offerId !== undefined) { url.searchParams.append("offerId", String(opts.offerId)); } if (opts["regionsVersion.version"] !== undefined) { url.searchParams.append("regionsVersion.version", String(opts["regionsVersion.version"])); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscriptionOffer(data); } /** * Deactivates a subscription offer. Once deactivated, existing subscribers * will maintain their subscription, but the offer will become unavailable to * new subscribers. * * @param basePlanId Required. The parent base plan (ID) of the offer to deactivate. * @param offerId Required. The unique offer ID of the offer to deactivate. * @param packageName Required. The parent app (package name) of the offer to deactivate. * @param productId Required. The parent subscription (ID) of the offer to deactivate. */ async monetizationSubscriptionsBasePlansOffersDeactivate(basePlanId: string, offerId: string, packageName: string, productId: string, req: DeactivateSubscriptionOfferRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers/${ offerId }:deactivate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscriptionOffer(data); } /** * Deletes a subscription offer. Can only be done for draft offers. This * action is irreversible. * * @param basePlanId Required. The parent base plan (ID) of the offer to delete. * @param offerId Required. The unique offer ID of the offer to delete. * @param packageName Required. The parent app (package name) of the offer to delete. * @param productId Required. The parent subscription (ID) of the offer to delete. */ async monetizationSubscriptionsBasePlansOffersDelete(basePlanId: string, offerId: string, packageName: string, productId: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers/${ offerId }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Reads a single offer * * @param basePlanId Required. The parent base plan (ID) of the offer to get. * @param offerId Required. The unique offer ID of the offer to get. * @param packageName Required. The parent app (package name) of the offer to get. * @param productId Required. The parent subscription (ID) of the offer to get. */ async monetizationSubscriptionsBasePlansOffersGet(basePlanId: string, offerId: string, packageName: string, productId: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers/${ offerId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubscriptionOffer(data); } /** * Lists all offers under a given subscription. * * @param basePlanId Required. The parent base plan (ID) for which the offers should be read. May be specified as '-' to read all offers under a subscription or an app. Must be specified as '-' if product_id is specified as '-'. * @param packageName Required. The parent app (package name) for which the subscriptions should be read. * @param productId Required. The parent subscription (ID) for which the offers should be read. May be specified as '-' to read all offers under an app. */ async monetizationSubscriptionsBasePlansOffersList(basePlanId: string, packageName: string, productId: string, opts: MonetizationSubscriptionsBasePlansOffersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListSubscriptionOffersResponse(data); } /** * Updates an existing subscription offer. * * @param basePlanId Required. Immutable. The ID of the base plan to which this offer is an extension. * @param offerId Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan. * @param packageName Required. Immutable. The package name of the app the parent subscription belongs to. * @param productId Required. Immutable. The ID of the parent subscription this offer belongs to. */ async monetizationSubscriptionsBasePlansOffersPatch(basePlanId: string, offerId: string, packageName: string, productId: string, req: SubscriptionOffer, opts: MonetizationSubscriptionsBasePlansOffersPatchOptions = {}): Promise { req = serializeSubscriptionOffer(req); opts = serializeMonetizationSubscriptionsBasePlansOffersPatchOptions(opts); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }/basePlans/${ basePlanId }/offers/${ offerId }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } if (opts.latencyTolerance !== undefined) { url.searchParams.append("latencyTolerance", String(opts.latencyTolerance)); } if (opts["regionsVersion.version"] !== undefined) { url.searchParams.append("regionsVersion.version", String(opts["regionsVersion.version"])); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeSubscriptionOffer(data); } /** * Reads one or more subscriptions. * * @param packageName Required. The parent app (package name) for which the subscriptions should be retrieved. Must be equal to the package_name field on all the requests. */ async monetizationSubscriptionsBatchGet(packageName: string, opts: MonetizationSubscriptionsBatchGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions:batchGet`); if (opts.productIds !== undefined) { url.searchParams.append("productIds", String(opts.productIds)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeBatchGetSubscriptionsResponse(data); } /** * Updates a batch of subscriptions. Set the latencyTolerance field on nested * requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve * maximum update throughput. * * @param packageName Required. The parent app (package name) for which the subscriptions should be updated. Must be equal to the package_name field on all the Subscription resources. */ async monetizationSubscriptionsBatchUpdate(packageName: string, req: BatchUpdateSubscriptionsRequest): Promise { req = serializeBatchUpdateSubscriptionsRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions:batchUpdate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeBatchUpdateSubscriptionsResponse(data); } /** * Creates a new subscription. Newly added base plans will remain in draft * state until activated. * * @param packageName 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. */ async monetizationSubscriptionsCreate(packageName: string, req: Subscription, opts: MonetizationSubscriptionsCreateOptions = {}): Promise { req = serializeSubscription(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions`); if (opts.productId !== undefined) { url.searchParams.append("productId", String(opts.productId)); } if (opts["regionsVersion.version"] !== undefined) { url.searchParams.append("regionsVersion.version", String(opts["regionsVersion.version"])); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscription(data); } /** * Deletes a subscription. A subscription can only be deleted if it has never * had a base plan published. * * @param packageName Required. The parent app (package name) of the app of the subscription to delete. * @param productId Required. The unique product ID of the subscription to delete. */ async monetizationSubscriptionsDelete(packageName: string, productId: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Reads a single subscription. * * @param packageName Required. The parent app (package name) of the subscription to get. * @param productId Required. The unique product ID of the subscription to get. */ async monetizationSubscriptionsGet(packageName: string, productId: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubscription(data); } /** * Lists all subscriptions under a given app. * * @param packageName Required. The parent app (package name) for which the subscriptions should be read. */ async monetizationSubscriptionsList(packageName: string, opts: MonetizationSubscriptionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showArchived !== undefined) { url.searchParams.append("showArchived", String(opts.showArchived)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListSubscriptionsResponse(data); } /** * Updates an existing subscription. * * @param packageName Immutable. Package name of the parent app. * @param 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. */ async monetizationSubscriptionsPatch(packageName: string, productId: string, req: Subscription, opts: MonetizationSubscriptionsPatchOptions = {}): Promise { req = serializeSubscription(req); opts = serializeMonetizationSubscriptionsPatchOptions(opts); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/subscriptions/${ productId }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } if (opts.latencyTolerance !== undefined) { url.searchParams.append("latencyTolerance", String(opts.latencyTolerance)); } if (opts["regionsVersion.version"] !== undefined) { url.searchParams.append("regionsVersion.version", String(opts["regionsVersion.version"])); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeSubscription(data); } /** * Refunds a user's subscription or in-app purchase order. Orders older than * 3 years cannot be refunded. * * @param orderId The order ID provided to the user when the subscription or in-app order was purchased. * @param packageName The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing'). */ async ordersRefund(orderId: string, packageName: string, opts: OrdersRefundOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/orders/${ orderId }:refund`); if (opts.revoke !== undefined) { url.searchParams.append("revoke", String(opts.revoke)); } const data = await request(url.href, { client: this.#client, method: "POST", }); } /** * Acknowledges a purchase of an inapp item. * * @param packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). * @param productId The inapp product SKU (for example, 'com.some.thing.inapp1'). * @param token The token provided to the user's device when the inapp product was purchased. */ async purchasesProductsAcknowledge(packageName: string, productId: string, token: string, req: ProductPurchasesAcknowledgeRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/products/${ productId }/tokens/${ token }:acknowledge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); } /** * Consumes a purchase for an inapp item. * * @param packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). * @param productId The inapp product SKU (for example, 'com.some.thing.inapp1'). * @param token The token provided to the user's device when the inapp product was purchased. */ async purchasesProductsConsume(packageName: string, productId: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/products/${ productId }/tokens/${ token }:consume`); const data = await request(url.href, { client: this.#client, method: "POST", }); } /** * Checks the purchase and consumption status of an inapp item. * * @param packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). * @param productId The inapp product SKU (for example, 'com.some.thing.inapp1'). * @param token The token provided to the user's device when the inapp product was purchased. */ async purchasesProductsGet(packageName: string, productId: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/products/${ productId }/tokens/${ token }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeProductPurchase(data); } /** * Acknowledges a subscription purchase. * * @param packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param subscriptionId The purchased subscription ID (for example, 'monthly001'). * @param token The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsAcknowledge(packageName: string, subscriptionId: string, token: string, req: SubscriptionPurchasesAcknowledgeRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptions/${ subscriptionId }/tokens/${ token }:acknowledge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); } /** * Cancels a user's subscription purchase. The subscription remains valid * until its expiration time. * * @param packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param subscriptionId The purchased subscription ID (for example, 'monthly001'). * @param token The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsCancel(packageName: string, subscriptionId: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptions/${ subscriptionId }/tokens/${ token }:cancel`); const data = await request(url.href, { client: this.#client, method: "POST", }); } /** * Defers a user's subscription purchase until a specified future expiration * time. * * @param packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param subscriptionId The purchased subscription ID (for example, 'monthly001'). * @param token The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsDefer(packageName: string, subscriptionId: string, token: string, req: SubscriptionPurchasesDeferRequest): Promise { req = serializeSubscriptionPurchasesDeferRequest(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptions/${ subscriptionId }/tokens/${ token }:defer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSubscriptionPurchasesDeferResponse(data); } /** * Checks whether a user's subscription purchase is valid and returns its * expiry time. * * @param packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param subscriptionId The purchased subscription ID (for example, 'monthly001'). * @param token The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsGet(packageName: string, subscriptionId: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptions/${ subscriptionId }/tokens/${ token }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubscriptionPurchase(data); } /** * Refunds a user's subscription purchase, but the subscription remains valid * until its expiration time and it will continue to recur. * * @param packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param subscriptionId "The purchased subscription ID (for example, 'monthly001'). * @param token The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsRefund(packageName: string, subscriptionId: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptions/${ subscriptionId }/tokens/${ token }:refund`); const data = await request(url.href, { client: this.#client, method: "POST", }); } /** * Refunds and immediately revokes a user's subscription purchase. Access to * the subscription will be terminated immediately and it will stop recurring. * * @param packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param subscriptionId The purchased subscription ID (for example, 'monthly001'). * @param token The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsRevoke(packageName: string, subscriptionId: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptions/${ subscriptionId }/tokens/${ token }:revoke`); const data = await request(url.href, { client: this.#client, method: "POST", }); } /** * Get metadata about a subscription * * @param packageName The package of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param token Required. The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsv2Get(packageName: string, token: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptionsv2/tokens/${ token }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSubscriptionPurchaseV2(data); } /** * Revoke a subscription purchase for the user. * * @param packageName Required. The package of the application for which this subscription was purchased (for example, 'com.some.thing'). * @param token Required. The token provided to the user's device when the subscription was purchased. */ async purchasesSubscriptionsv2Revoke(packageName: string, token: string, req: RevokeSubscriptionPurchaseRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/subscriptionsv2/tokens/${ token }:revoke`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as RevokeSubscriptionPurchaseResponse; } /** * Lists the purchases that were canceled, refunded or charged-back. * * @param packageName The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). */ async purchasesVoidedpurchasesList(packageName: string, opts: PurchasesVoidedpurchasesListOptions = {}): Promise { opts = serializePurchasesVoidedpurchasesListOptions(opts); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/purchases/voidedpurchases`); if (opts.endTime !== undefined) { url.searchParams.append("endTime", String(opts.endTime)); } if (opts.includeQuantityBasedPartialRefund !== undefined) { url.searchParams.append("includeQuantityBasedPartialRefund", String(opts.includeQuantityBasedPartialRefund)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.startIndex !== undefined) { url.searchParams.append("startIndex", String(opts.startIndex)); } if (opts.startTime !== undefined) { url.searchParams.append("startTime", String(opts.startTime)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } if (opts.type !== undefined) { url.searchParams.append("type", String(opts.type)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVoidedPurchasesListResponse(data); } /** * Gets a single review. * * @param packageName Package name of the app. * @param reviewId Unique identifier for a review. */ async reviewsGet(packageName: string, reviewId: string, opts: ReviewsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/reviews/${ reviewId }`); if (opts.translationLanguage !== undefined) { url.searchParams.append("translationLanguage", String(opts.translationLanguage)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeReview(data); } /** * Lists all reviews. * * @param packageName Package name of the app. */ async reviewsList(packageName: string, opts: ReviewsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/reviews`); if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.startIndex !== undefined) { url.searchParams.append("startIndex", String(opts.startIndex)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } if (opts.translationLanguage !== undefined) { url.searchParams.append("translationLanguage", String(opts.translationLanguage)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeReviewsListResponse(data); } /** * Replies to a single review, or updates an existing reply. * * @param packageName Package name of the app. * @param reviewId Unique identifier for a review. */ async reviewsReply(packageName: string, reviewId: string, req: ReviewsReplyRequest): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/reviews/${ reviewId }:reply`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeReviewsReplyResponse(data); } /** * Creates an APK which is suitable for inclusion in a system image from an * already uploaded Android App Bundle. * * @param packageName Package name of the app. * @param versionCode The version code of the App Bundle. */ async systemapksVariantsCreate(packageName: string, versionCode: bigint, req: Variant): Promise { versionCode = String(versionCode); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/systemApks/${ versionCode }/variants`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Variant; } /** * Downloads a previously created system APK which is suitable for inclusion * in a system image. * * @param packageName Package name of the app. * @param variantId The ID of a previously created system APK variant. * @param versionCode The version code of the App Bundle. */ async systemapksVariantsDownload(packageName: string, variantId: number, versionCode: bigint): Promise { versionCode = String(versionCode); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/systemApks/${ versionCode }/variants/${ variantId }:download`); const data = await request(url.href, { client: this.#client, method: "GET", }); } /** * Returns a previously created system APK variant. * * @param packageName Package name of the app. * @param variantId The ID of a previously created system APK variant. * @param versionCode The version code of the App Bundle. */ async systemapksVariantsGet(packageName: string, variantId: number, versionCode: bigint): Promise { versionCode = String(versionCode); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/systemApks/${ versionCode }/variants/${ variantId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Variant; } /** * Returns the list of previously created system APK variants. * * @param packageName Package name of the app. * @param versionCode The version code of the App Bundle. */ async systemapksVariantsList(packageName: string, versionCode: bigint): Promise { versionCode = String(versionCode); const url = new URL(`${this.#baseUrl}androidpublisher/v3/applications/${ packageName }/systemApks/${ versionCode }/variants`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as SystemApksListResponse; } /** * Grant access for a user to the given developer account. * * @param parent Required. The developer account to add the user to. Format: developers/{developer} */ async usersCreate(parent: string, req: User): Promise { req = serializeUser(req); const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ parent }/users`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeUser(data); } /** * Removes all access for the user to the given developer account. * * @param name Required. The name of the user to delete. Format: developers/{developer}/users/{email} */ async usersDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); } /** * Lists all users with access to a developer account. * * @param parent Required. The developer account to fetch users from. Format: developers/{developer} */ async usersList(parent: string, opts: UsersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ parent }/users`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListUsersResponse(data); } /** * Updates access for the user to the developer account. * * @param name Required. Resource name for this user, following the pattern "developers/{developer}/users/{email}". */ async usersPatch(name: string, req: User, opts: UsersPatchOptions = {}): Promise { req = serializeUser(req); opts = serializeUsersPatchOptions(opts); const url = new URL(`${this.#baseUrl}androidpublisher/v3/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeUser(data); } } /** * Represents an Abi. */ export interface Abi { /** * Alias for an abi. */ alias?: | "UNSPECIFIED_CPU_ARCHITECTURE" | "ARMEABI" | "ARMEABI_V7A" | "ARM64_V8A" | "X86" | "X86_64" | "RISCV64"; } /** * Targeting based on Abi. */ export interface AbiTargeting { /** * Targeting of other sibling directories that were in the Bundle. For main * splits this is targeting of other main splits. */ alternatives?: Abi[]; /** * Value of an abi. */ value?: Abi[]; } /** * Represents a targeting rule of the form: User never had {scope} before. */ export interface AcquisitionTargetingRule { /** * Required. The scope of subscriptions this rule considers. Only allows * "this subscription" and "any subscription in app". */ scope?: TargetingRuleScope; } /** * Request message for ActivateBasePlan. */ export interface ActivateBasePlanRequest { /** * Required. The unique base plan ID of the base plan to activate. */ basePlanId?: string; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. The parent app (package name) of the base plan to activate. */ packageName?: string; /** * Required. The parent subscription (ID) of the base plan to activate. */ productId?: string; } /** * Request message for ActivateSubscriptionOffer. */ export interface ActivateSubscriptionOfferRequest { /** * Required. The parent base plan (ID) of the offer to activate. */ basePlanId?: string; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. The unique offer ID of the offer to activate. */ offerId?: string; /** * Required. The parent app (package name) of the offer to activate. */ packageName?: string; /** * Required. The parent subscription (ID) of the offer to activate. */ productId?: string; } /** * Request message for AddTargeting. */ export interface AddTargetingRequest { /** * Specifies targeting updates such as regions, android sdk versions etc. */ targetingUpdate?: TargetingUpdate; } function serializeAddTargetingRequest(data: any): AddTargetingRequest { return { ...data, targetingUpdate: data["targetingUpdate"] !== undefined ? serializeTargetingUpdate(data["targetingUpdate"]) : undefined, }; } function deserializeAddTargetingRequest(data: any): AddTargetingRequest { return { ...data, targetingUpdate: data["targetingUpdate"] !== undefined ? deserializeTargetingUpdate(data["targetingUpdate"]) : undefined, }; } /** * Response message for AddTargeting. */ export interface AddTargetingResponse { } /** * Object representation to describe all set of users. */ export interface AllUsers { /** * Required. Set to true if all set of users are needed. */ isAllUsersRequested?: boolean; } /** * Android api level targeting data for app recovery action targeting. */ export interface AndroidSdks { /** * Android api levels of devices targeted by recovery action. See * https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels * for different api levels in android. */ sdkLevels?: bigint[]; } function serializeAndroidSdks(data: any): AndroidSdks { return { ...data, sdkLevels: data["sdkLevels"] !== undefined ? data["sdkLevels"].map((item: any) => (String(item))) : undefined, }; } function deserializeAndroidSdks(data: any): AndroidSdks { return { ...data, sdkLevels: data["sdkLevels"] !== undefined ? data["sdkLevels"].map((item: any) => (BigInt(item))) : undefined, }; } /** * Information about an APK. The resource for ApksService. */ export interface Apk { /** * Information about the binary payload of this APK. */ binary?: ApkBinary; /** * The version code of the APK, as specified in the manifest file. */ versionCode?: number; } /** * Represents the binary payload of an APK. */ export interface ApkBinary { /** * A sha1 hash of the APK payload, encoded as a hex string and matching the * output of the sha1sum command. */ sha1?: string; /** * A sha256 hash of the APK payload, encoded as a hex string and matching the * output of the sha256sum command. */ sha256?: string; } /** * Description of the created apks. */ export interface ApkDescription { /** * Set only for asset slices. */ assetSliceMetadata?: SplitApkMetadata; /** * Set only for Instant split APKs. */ instantApkMetadata?: SplitApkMetadata; /** * Path of the Apk, will be in the following format: .apk where DownloadId is * the ID used to download the apk using GeneratedApks.Download API. */ path?: string; /** * Set only for Split APKs. */ splitApkMetadata?: SplitApkMetadata; /** * Set only for standalone APKs. */ standaloneApkMetadata?: StandaloneApkMetadata; /** * Apk-level targeting. */ targeting?: ApkTargeting; } /** * Request to create a new externally hosted APK. */ export interface ApksAddExternallyHostedRequest { /** * The definition of the externally-hosted APK and where it is located. */ externallyHostedApk?: ExternallyHostedApk; } function serializeApksAddExternallyHostedRequest(data: any): ApksAddExternallyHostedRequest { return { ...data, externallyHostedApk: data["externallyHostedApk"] !== undefined ? serializeExternallyHostedApk(data["externallyHostedApk"]) : undefined, }; } function deserializeApksAddExternallyHostedRequest(data: any): ApksAddExternallyHostedRequest { return { ...data, externallyHostedApk: data["externallyHostedApk"] !== undefined ? deserializeExternallyHostedApk(data["externallyHostedApk"]) : undefined, }; } /** * Response for creating a new externally hosted APK. */ export interface ApksAddExternallyHostedResponse { /** * The definition of the externally-hosted APK and where it is located. */ externallyHostedApk?: ExternallyHostedApk; } function serializeApksAddExternallyHostedResponse(data: any): ApksAddExternallyHostedResponse { return { ...data, externallyHostedApk: data["externallyHostedApk"] !== undefined ? serializeExternallyHostedApk(data["externallyHostedApk"]) : undefined, }; } function deserializeApksAddExternallyHostedResponse(data: any): ApksAddExternallyHostedResponse { return { ...data, externallyHostedApk: data["externallyHostedApk"] !== undefined ? deserializeExternallyHostedApk(data["externallyHostedApk"]) : undefined, }; } /** * A set of apks representing a module. */ export interface ApkSet { /** * Description of the generated apks. */ apkDescription?: ApkDescription[]; /** * Metadata about the module represented by this ApkSet */ moduleMetadata?: ModuleMetadata; } /** * Response listing all APKs. */ export interface ApksListResponse { /** * All APKs. */ apks?: Apk[]; /** * The kind of this response ("androidpublisher#apksListResponse"). */ kind?: string; } /** * Represents a set of apk-level targetings. */ export interface ApkTargeting { /** * The abi that the apk targets */ abiTargeting?: AbiTargeting; /** * The language that the apk targets */ languageTargeting?: LanguageTargeting; /** * Multi-api-level targeting. */ multiAbiTargeting?: MultiAbiTargeting; /** * The screen density that this apk supports. */ screenDensityTargeting?: ScreenDensityTargeting; /** * The sdk version that the apk targets */ sdkVersionTargeting?: SdkVersionTargeting; /** * Texture-compression-format-level targeting */ textureCompressionFormatTargeting?: TextureCompressionFormatTargeting; } /** * The app details. The resource for DetailsService. */ export interface AppDetails { /** * The user-visible support email for this app. */ contactEmail?: string; /** * The user-visible support telephone number for this app. */ contactPhone?: string; /** * The user-visible website for this app. */ contactWebsite?: string; /** * Default language code, in BCP 47 format (eg "en-US"). */ defaultLanguage?: string; } /** * An app edit. The resource for EditsService. */ export interface AppEdit { /** * Output only. The time (as seconds since Epoch) at which the edit will * expire and will be no longer valid for use. */ readonly expiryTimeSeconds?: string; /** * Output only. Identifier of the edit. Can be used in subsequent API calls. */ readonly id?: string; } /** * Additional options for Androidpublisher#applicationsDeviceTierConfigsCreate. */ export interface ApplicationsDeviceTierConfigsCreateOptions { /** * Whether the service should accept device IDs that are unknown to Play's * device catalog. */ allowUnknownDevices?: boolean; } /** * Additional options for Androidpublisher#applicationsDeviceTierConfigsList. */ export interface ApplicationsDeviceTierConfigsListOptions { /** * 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; } /** * Information about an app recovery action. */ export interface AppRecoveryAction { /** * ID corresponding to the app recovery action. */ appRecoveryId?: bigint; /** * Timestamp of when the app recovery action is canceled by the developer. * Only set if the recovery action has been canceled. */ cancelTime?: Date; /** * Timestamp of when the app recovery action is created by the developer. It * is always set after creation of the recovery action. */ createTime?: Date; /** * Timestamp of when the app recovery action is deployed to the users. Only * set if the recovery action has been deployed. */ deployTime?: Date; /** * Timestamp of when the developer last updated recovery action. In case the * action is cancelled, it corresponds to cancellation time. It is always set * after creation of the recovery action. */ lastUpdateTime?: Date; /** * Data about the remote in-app update action such as such as recovered user * base, recoverable user base etc. Set only if the recovery action type is * Remote In-App Update. */ remoteInAppUpdateData?: RemoteInAppUpdateData; /** * The status of the recovery action. */ status?: | "RECOVERY_STATUS_UNSPECIFIED" | "RECOVERY_STATUS_ACTIVE" | "RECOVERY_STATUS_CANCELED" | "RECOVERY_STATUS_DRAFT" | "RECOVERY_STATUS_GENERATION_IN_PROGRESS" | "RECOVERY_STATUS_GENERATION_FAILED"; /** * Specifies targeting criteria for the recovery action such as regions, * android sdk versions, app versions etc. */ targeting?: Targeting; } function serializeAppRecoveryAction(data: any): AppRecoveryAction { return { ...data, appRecoveryId: data["appRecoveryId"] !== undefined ? String(data["appRecoveryId"]) : undefined, cancelTime: data["cancelTime"] !== undefined ? data["cancelTime"].toISOString() : undefined, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, deployTime: data["deployTime"] !== undefined ? data["deployTime"].toISOString() : undefined, lastUpdateTime: data["lastUpdateTime"] !== undefined ? data["lastUpdateTime"].toISOString() : undefined, remoteInAppUpdateData: data["remoteInAppUpdateData"] !== undefined ? serializeRemoteInAppUpdateData(data["remoteInAppUpdateData"]) : undefined, targeting: data["targeting"] !== undefined ? serializeTargeting(data["targeting"]) : undefined, }; } function deserializeAppRecoveryAction(data: any): AppRecoveryAction { return { ...data, appRecoveryId: data["appRecoveryId"] !== undefined ? BigInt(data["appRecoveryId"]) : undefined, cancelTime: data["cancelTime"] !== undefined ? new Date(data["cancelTime"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, deployTime: data["deployTime"] !== undefined ? new Date(data["deployTime"]) : undefined, lastUpdateTime: data["lastUpdateTime"] !== undefined ? new Date(data["lastUpdateTime"]) : undefined, remoteInAppUpdateData: data["remoteInAppUpdateData"] !== undefined ? deserializeRemoteInAppUpdateData(data["remoteInAppUpdateData"]) : undefined, targeting: data["targeting"] !== undefined ? deserializeTargeting(data["targeting"]) : undefined, }; } /** * Additional options for Androidpublisher#apprecoveryList. */ export interface ApprecoveryListOptions { /** * Required. Version code targeted by the list of recovery actions. */ versionCode?: bigint; } function serializeApprecoveryListOptions(data: any): ApprecoveryListOptions { return { ...data, versionCode: data["versionCode"] !== undefined ? String(data["versionCode"]) : undefined, }; } function deserializeApprecoveryListOptions(data: any): ApprecoveryListOptions { return { ...data, versionCode: data["versionCode"] !== undefined ? BigInt(data["versionCode"]) : undefined, }; } /** * Data format for a list of app versions. */ export interface AppVersionList { /** * List of app version codes. */ versionCodes?: bigint[]; } function serializeAppVersionList(data: any): AppVersionList { return { ...data, versionCodes: data["versionCodes"] !== undefined ? data["versionCodes"].map((item: any) => (String(item))) : undefined, }; } function deserializeAppVersionList(data: any): AppVersionList { return { ...data, versionCodes: data["versionCodes"] !== undefined ? data["versionCodes"].map((item: any) => (BigInt(item))) : undefined, }; } /** * Data format for a continuous range of app versions. */ export interface AppVersionRange { /** * Highest app version in the range, inclusive. */ versionCodeEnd?: bigint; /** * Lowest app version in the range, inclusive. */ versionCodeStart?: bigint; } function serializeAppVersionRange(data: any): AppVersionRange { return { ...data, versionCodeEnd: data["versionCodeEnd"] !== undefined ? String(data["versionCodeEnd"]) : undefined, versionCodeStart: data["versionCodeStart"] !== undefined ? String(data["versionCodeStart"]) : undefined, }; } function deserializeAppVersionRange(data: any): AppVersionRange { return { ...data, versionCodeEnd: data["versionCodeEnd"] !== undefined ? BigInt(data["versionCodeEnd"]) : undefined, versionCodeStart: data["versionCodeStart"] !== undefined ? BigInt(data["versionCodeStart"]) : undefined, }; } /** * Deprecated: subscription archiving is not supported. */ export interface ArchiveSubscriptionRequest { } /** * Metadata of an asset module. */ export interface AssetModuleMetadata { /** * Indicates the delivery type for persistent install. */ deliveryType?: | "UNKNOWN_DELIVERY_TYPE" | "INSTALL_TIME" | "ON_DEMAND" | "FAST_FOLLOW"; /** * Module name. */ name?: string; } /** * Set of asset slices belonging to a single asset module. */ export interface AssetSliceSet { /** * Asset slices. */ apkDescription?: ApkDescription[]; /** * Module level metadata. */ assetModuleMetadata?: AssetModuleMetadata; } /** * Represents a base plan that automatically renews at the end of its * subscription period. */ export interface AutoRenewingBasePlanType { /** * Optional. Account hold period of the subscription, specified in ISO 8601 * format. Acceptable values must be in DAYS and in the range P0D (zero days) * to P30D (30 days). If not specified, the default value is P30D (30 days). */ accountHoldDuration?: string; /** * Required. Immutable. Subscription period, specified in ISO 8601 format. * For a list of acceptable billing periods, refer to the help center. The * duration is immutable after the base plan is created. */ billingPeriodDuration?: string; /** * 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; /** * Whether the renewing base plan is backward compatible. The backward * compatible base plan is returned by the Google Play Billing Library * deprecated method querySkuDetailsAsync(). Only one renewing base plan can * be marked as legacy compatible for a given subscription. */ legacyCompatible?: boolean; /** * Subscription offer id which is legacy compatible. The backward compatible * subscription offer is returned by the Google Play Billing Library * deprecated method querySkuDetailsAsync(). Only one subscription offer can * be marked as legacy compatible for a given renewing base plan. To have no * Subscription offer as legacy compatible set this field as empty string. */ legacyCompatibleSubscriptionOfferId?: string; /** * 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. */ prorationMode?: | "SUBSCRIPTION_PRORATION_MODE_UNSPECIFIED" | "SUBSCRIPTION_PRORATION_MODE_CHARGE_ON_NEXT_BILLING_DATE" | "SUBSCRIPTION_PRORATION_MODE_CHARGE_FULL_PRICE_IMMEDIATELY"; /** * Whether users should be able to resubscribe to this base plan in Google * Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified. */ resubscribeState?: | "RESUBSCRIBE_STATE_UNSPECIFIED" | "RESUBSCRIBE_STATE_ACTIVE" | "RESUBSCRIBE_STATE_INACTIVE"; } /** * Information related to an auto renewing plan. */ export interface AutoRenewingPlan { /** * If the subscription is currently set to auto-renew, e.g. the user has not * canceled the subscription */ autoRenewEnabled?: boolean; /** * The installment plan commitment and state related info for the auto * renewing plan. */ installmentDetails?: InstallmentPlan; /** * The information of the last price change for the item since subscription * signup. */ priceChangeDetails?: SubscriptionItemPriceChangeDetails; } function serializeAutoRenewingPlan(data: any): AutoRenewingPlan { return { ...data, priceChangeDetails: data["priceChangeDetails"] !== undefined ? serializeSubscriptionItemPriceChangeDetails(data["priceChangeDetails"]) : undefined, }; } function deserializeAutoRenewingPlan(data: any): AutoRenewingPlan { return { ...data, priceChangeDetails: data["priceChangeDetails"] !== undefined ? deserializeSubscriptionItemPriceChangeDetails(data["priceChangeDetails"]) : undefined, }; } /** * A single base plan for a subscription. */ export interface BasePlan { /** * Set when the base plan automatically renews at a regular interval. */ autoRenewingBasePlanType?: AutoRenewingBasePlanType; /** * 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; /** * Set for installments base plans where a user is committed to a specified * number of payments. */ installmentsBasePlanType?: InstallmentsBasePlanType; /** * 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[]; /** * 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; /** * Set when the base plan does not automatically renew at the end of the * billing period. */ prepaidBasePlanType?: PrepaidBasePlanType; /** * Region-specific information for this base plan. */ regionalConfigs?: RegionalBasePlanConfig[]; /** * 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. */ readonly state?: | "STATE_UNSPECIFIED" | "DRAFT" | "ACTIVE" | "INACTIVE"; } function serializeBasePlan(data: any): BasePlan { return { ...data, otherRegionsConfig: data["otherRegionsConfig"] !== undefined ? serializeOtherRegionsBasePlanConfig(data["otherRegionsConfig"]) : undefined, regionalConfigs: data["regionalConfigs"] !== undefined ? data["regionalConfigs"].map((item: any) => (serializeRegionalBasePlanConfig(item))) : undefined, }; } function deserializeBasePlan(data: any): BasePlan { return { ...data, otherRegionsConfig: data["otherRegionsConfig"] !== undefined ? deserializeOtherRegionsBasePlanConfig(data["otherRegionsConfig"]) : undefined, regionalConfigs: data["regionalConfigs"] !== undefined ? data["regionalConfigs"].map((item: any) => (deserializeRegionalBasePlanConfig(item))) : undefined, }; } /** * Request message for BatchGetSubscriptionOffers endpoint. */ export interface BatchGetSubscriptionOffersRequest { /** * Required. A list of update requests of up to 100 elements. All requests * must update different subscriptions. */ requests?: GetSubscriptionOfferRequest[]; } /** * Response message for BatchGetSubscriptionOffers endpoint. */ export interface BatchGetSubscriptionOffersResponse { subscriptionOffers?: SubscriptionOffer[]; } function serializeBatchGetSubscriptionOffersResponse(data: any): BatchGetSubscriptionOffersResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (serializeSubscriptionOffer(item))) : undefined, }; } function deserializeBatchGetSubscriptionOffersResponse(data: any): BatchGetSubscriptionOffersResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (deserializeSubscriptionOffer(item))) : undefined, }; } /** * Response message for BatchGetSubscriptions endpoint. */ export interface BatchGetSubscriptionsResponse { /** * The list of requested subscriptions, in the same order as the request. */ subscriptions?: Subscription[]; } function serializeBatchGetSubscriptionsResponse(data: any): BatchGetSubscriptionsResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (serializeSubscription(item))) : undefined, }; } function deserializeBatchGetSubscriptionsResponse(data: any): BatchGetSubscriptionsResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (deserializeSubscription(item))) : undefined, }; } /** * Request message for BatchMigrateBasePlanPrices. */ export interface BatchMigrateBasePlanPricesRequest { /** * Required. Up to 100 price migration requests. All requests must update * different base plans. */ requests?: MigrateBasePlanPricesRequest[]; } function serializeBatchMigrateBasePlanPricesRequest(data: any): BatchMigrateBasePlanPricesRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (serializeMigrateBasePlanPricesRequest(item))) : undefined, }; } function deserializeBatchMigrateBasePlanPricesRequest(data: any): BatchMigrateBasePlanPricesRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (deserializeMigrateBasePlanPricesRequest(item))) : undefined, }; } /** * Response message for BatchMigrateBasePlanPrices. */ export interface BatchMigrateBasePlanPricesResponse { /** * Contains one response per requested price migration, in the same order as * the request. */ responses?: MigrateBasePlanPricesResponse[]; } /** * Request message for BatchUpdateBasePlanStates. */ export interface BatchUpdateBasePlanStatesRequest { /** * Required. The update request list of up to 100 elements. All requests must * update different base plans. */ requests?: UpdateBasePlanStateRequest[]; } /** * Response message for BatchUpdateBasePlanStates. */ export interface BatchUpdateBasePlanStatesResponse { /** * The list of updated subscriptions. This list will match the requests one * to one, in the same order. */ subscriptions?: Subscription[]; } function serializeBatchUpdateBasePlanStatesResponse(data: any): BatchUpdateBasePlanStatesResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (serializeSubscription(item))) : undefined, }; } function deserializeBatchUpdateBasePlanStatesResponse(data: any): BatchUpdateBasePlanStatesResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (deserializeSubscription(item))) : undefined, }; } /** * Request message for BatchUpdateSubscriptionOffers. */ export interface BatchUpdateSubscriptionOffersRequest { /** * Required. A list of update requests of up to 100 elements. All requests * must update different subscription offers. */ requests?: UpdateSubscriptionOfferRequest[]; } function serializeBatchUpdateSubscriptionOffersRequest(data: any): BatchUpdateSubscriptionOffersRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (serializeUpdateSubscriptionOfferRequest(item))) : undefined, }; } function deserializeBatchUpdateSubscriptionOffersRequest(data: any): BatchUpdateSubscriptionOffersRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (deserializeUpdateSubscriptionOfferRequest(item))) : undefined, }; } /** * Response message for BatchUpdateSubscriptionOffers. */ export interface BatchUpdateSubscriptionOffersResponse { /** * The updated subscription offers list. */ subscriptionOffers?: SubscriptionOffer[]; } function serializeBatchUpdateSubscriptionOffersResponse(data: any): BatchUpdateSubscriptionOffersResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (serializeSubscriptionOffer(item))) : undefined, }; } function deserializeBatchUpdateSubscriptionOffersResponse(data: any): BatchUpdateSubscriptionOffersResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (deserializeSubscriptionOffer(item))) : undefined, }; } /** * Request message for BatchUpdateSubscriptionOfferStates. */ export interface BatchUpdateSubscriptionOfferStatesRequest { /** * Required. The update request list of up to 100 elements. All requests must * update different offers. */ requests?: UpdateSubscriptionOfferStateRequest[]; } /** * Response message for BatchUpdateSubscriptionOfferStates. */ export interface BatchUpdateSubscriptionOfferStatesResponse { /** * The updated subscription offers list. */ subscriptionOffers?: SubscriptionOffer[]; } function serializeBatchUpdateSubscriptionOfferStatesResponse(data: any): BatchUpdateSubscriptionOfferStatesResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (serializeSubscriptionOffer(item))) : undefined, }; } function deserializeBatchUpdateSubscriptionOfferStatesResponse(data: any): BatchUpdateSubscriptionOfferStatesResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (deserializeSubscriptionOffer(item))) : undefined, }; } /** * Request message for BatchUpdateSubscription. */ export interface BatchUpdateSubscriptionsRequest { /** * Required. A list of update requests of up to 100 elements. All requests * must update different subscriptions. */ requests?: UpdateSubscriptionRequest[]; } function serializeBatchUpdateSubscriptionsRequest(data: any): BatchUpdateSubscriptionsRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (serializeUpdateSubscriptionRequest(item))) : undefined, }; } function deserializeBatchUpdateSubscriptionsRequest(data: any): BatchUpdateSubscriptionsRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (deserializeUpdateSubscriptionRequest(item))) : undefined, }; } /** * Response message for BatchUpdateSubscription. */ export interface BatchUpdateSubscriptionsResponse { /** * The updated subscriptions list. */ subscriptions?: Subscription[]; } function serializeBatchUpdateSubscriptionsResponse(data: any): BatchUpdateSubscriptionsResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (serializeSubscription(item))) : undefined, }; } function deserializeBatchUpdateSubscriptionsResponse(data: any): BatchUpdateSubscriptionsResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (deserializeSubscription(item))) : undefined, }; } /** * Information about an app bundle. The resource for BundlesService. */ export interface Bundle { /** * A sha1 hash of the upload payload, encoded as a hex string and matching * the output of the sha1sum command. */ sha1?: string; /** * A sha256 hash of the upload payload, encoded as a hex string and matching * the output of the sha256sum command. */ sha256?: string; /** * The version code of the Android App Bundle, as specified in the Android * App Bundle's base module APK manifest file. */ versionCode?: number; } /** * Response listing all app bundles. */ export interface BundlesListResponse { /** * All app bundles. */ bundles?: Bundle[]; /** * The kind of this response ("androidpublisher#bundlesListResponse"). */ kind?: string; } /** * Request message for CancelAppRecovery. */ export interface CancelAppRecoveryRequest { } /** * Response message for CancelAppRecovery. */ export interface CancelAppRecoveryResponse { } /** * Information specific to a subscription in the SUBSCRIPTION_STATE_CANCELED or * SUBSCRIPTION_STATE_EXPIRED state. */ export interface CanceledStateContext { /** * Subscription was canceled by the developer. */ developerInitiatedCancellation?: DeveloperInitiatedCancellation; /** * Subscription was replaced by a new subscription. */ replacementCancellation?: ReplacementCancellation; /** * Subscription was canceled by the system, for example because of a billing * problem. */ systemInitiatedCancellation?: SystemInitiatedCancellation; /** * Subscription was canceled by user. */ userInitiatedCancellation?: UserInitiatedCancellation; } function serializeCanceledStateContext(data: any): CanceledStateContext { return { ...data, userInitiatedCancellation: data["userInitiatedCancellation"] !== undefined ? serializeUserInitiatedCancellation(data["userInitiatedCancellation"]) : undefined, }; } function deserializeCanceledStateContext(data: any): CanceledStateContext { return { ...data, userInitiatedCancellation: data["userInitiatedCancellation"] !== undefined ? deserializeUserInitiatedCancellation(data["userInitiatedCancellation"]) : undefined, }; } /** * Result of the cancel survey when the subscription was canceled by the user. */ export interface CancelSurveyResult { /** * The reason the user selected in the cancel survey. */ reason?: | "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"; /** * Only set for CANCEL_SURVEY_REASON_OTHERS. This is the user's freeform * response to the survey. */ reasonUserInput?: string; } /** * An entry of conversation between user and developer. */ export interface Comment { /** * A comment from a developer. */ developerComment?: DeveloperComment; /** * A comment from a user. */ userComment?: UserComment; } function serializeComment(data: any): Comment { return { ...data, developerComment: data["developerComment"] !== undefined ? serializeDeveloperComment(data["developerComment"]) : undefined, userComment: data["userComment"] !== undefined ? serializeUserComment(data["userComment"]) : undefined, }; } function deserializeComment(data: any): Comment { return { ...data, developerComment: data["developerComment"] !== undefined ? deserializeDeveloperComment(data["developerComment"]) : undefined, userComment: data["userComment"] !== undefined ? deserializeUserComment(data["userComment"]) : undefined, }; } /** * Converted other regions prices. */ export interface ConvertedOtherRegionsPrice { /** * Price in EUR to use for the "Other regions" location exclusive of taxes. */ eurPrice?: Money; /** * Price in USD to use for the "Other regions" location exclusive of taxes. */ usdPrice?: Money; } function serializeConvertedOtherRegionsPrice(data: any): ConvertedOtherRegionsPrice { return { ...data, eurPrice: data["eurPrice"] !== undefined ? serializeMoney(data["eurPrice"]) : undefined, usdPrice: data["usdPrice"] !== undefined ? serializeMoney(data["usdPrice"]) : undefined, }; } function deserializeConvertedOtherRegionsPrice(data: any): ConvertedOtherRegionsPrice { return { ...data, eurPrice: data["eurPrice"] !== undefined ? deserializeMoney(data["eurPrice"]) : undefined, usdPrice: data["usdPrice"] !== undefined ? deserializeMoney(data["usdPrice"]) : undefined, }; } /** * A converted region price. */ export interface ConvertedRegionPrice { /** * The converted price tax inclusive. */ price?: Money; /** * The region code of the region. */ regionCode?: string; /** * The tax amount of the converted price. */ taxAmount?: Money; } function serializeConvertedRegionPrice(data: any): ConvertedRegionPrice { return { ...data, price: data["price"] !== undefined ? serializeMoney(data["price"]) : undefined, taxAmount: data["taxAmount"] !== undefined ? serializeMoney(data["taxAmount"]) : undefined, }; } function deserializeConvertedRegionPrice(data: any): ConvertedRegionPrice { return { ...data, price: data["price"] !== undefined ? deserializeMoney(data["price"]) : undefined, taxAmount: data["taxAmount"] !== undefined ? deserializeMoney(data["taxAmount"]) : undefined, }; } /** * Request message for ConvertRegionPrices. */ export interface ConvertRegionPricesRequest { /** * The intital price to convert other regions from. Tax exclusive. */ price?: Money; } function serializeConvertRegionPricesRequest(data: any): ConvertRegionPricesRequest { return { ...data, price: data["price"] !== undefined ? serializeMoney(data["price"]) : undefined, }; } function deserializeConvertRegionPricesRequest(data: any): ConvertRegionPricesRequest { return { ...data, price: data["price"] !== undefined ? deserializeMoney(data["price"]) : undefined, }; } /** * Response message for ConvertRegionPrices. */ export interface ConvertRegionPricesResponse { /** * Converted other regions prices in USD and EUR, to use for countries where * Play doesn't support a country's local currency. */ convertedOtherRegionsPrice?: ConvertedOtherRegionsPrice; /** * Map from region code to converted region price. */ convertedRegionPrices?: { [key: string]: ConvertedRegionPrice }; } function serializeConvertRegionPricesResponse(data: any): ConvertRegionPricesResponse { return { ...data, convertedOtherRegionsPrice: data["convertedOtherRegionsPrice"] !== undefined ? serializeConvertedOtherRegionsPrice(data["convertedOtherRegionsPrice"]) : undefined, convertedRegionPrices: data["convertedRegionPrices"] !== undefined ? Object.fromEntries(Object.entries(data["convertedRegionPrices"]).map(([k, v]: [string, any]) => ([k, serializeConvertedRegionPrice(v)]))) : undefined, }; } function deserializeConvertRegionPricesResponse(data: any): ConvertRegionPricesResponse { return { ...data, convertedOtherRegionsPrice: data["convertedOtherRegionsPrice"] !== undefined ? deserializeConvertedOtherRegionsPrice(data["convertedOtherRegionsPrice"]) : undefined, convertedRegionPrices: data["convertedRegionPrices"] !== undefined ? Object.fromEntries(Object.entries(data["convertedRegionPrices"]).map(([k, v]: [string, any]) => ([k, deserializeConvertedRegionPrice(v)]))) : undefined, }; } /** * Country targeting specification. */ export interface CountryTargeting { /** * Countries to target, specified as two letter [CLDR * codes](https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html). */ countries?: string[]; /** * Include "rest of world" as well as explicitly targeted countries. */ includeRestOfWorld?: boolean; } /** * Request message for CreateDraftAppRecovery. */ export interface CreateDraftAppRecoveryRequest { /** * Action type is remote in-app update. As a consequence of this action, a * downloadable recovery module is also created for testing purposes. */ remoteInAppUpdate?: RemoteInAppUpdate; /** * Specifies targeting criteria for the recovery action such as regions, * android sdk versions, app versions etc. */ targeting?: Targeting; } function serializeCreateDraftAppRecoveryRequest(data: any): CreateDraftAppRecoveryRequest { return { ...data, targeting: data["targeting"] !== undefined ? serializeTargeting(data["targeting"]) : undefined, }; } function deserializeCreateDraftAppRecoveryRequest(data: any): CreateDraftAppRecoveryRequest { return { ...data, targeting: data["targeting"] !== undefined ? deserializeTargeting(data["targeting"]) : undefined, }; } /** * Request message for DeactivateBasePlan. */ export interface DeactivateBasePlanRequest { /** * Required. The unique base plan ID of the base plan to deactivate. */ basePlanId?: string; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. The parent app (package name) of the base plan to deactivate. */ packageName?: string; /** * Required. The parent subscription (ID) of the base plan to deactivate. */ productId?: string; } /** * Request message for DeactivateSubscriptionOffer. */ export interface DeactivateSubscriptionOfferRequest { /** * Required. The parent base plan (ID) of the offer to deactivate. */ basePlanId?: string; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. The unique offer ID of the offer to deactivate. */ offerId?: string; /** * Required. The parent app (package name) of the offer to deactivate. */ packageName?: string; /** * Required. The parent subscription (ID) of the offer to deactivate. */ productId?: string; } /** * Information related to deferred item replacement. */ export interface DeferredItemReplacement { /** * The product_id going to replace the existing product_id. */ productId?: string; } /** * Represents a deobfuscation file. */ export interface DeobfuscationFile { /** * The type of the deobfuscation file. */ symbolType?: | "deobfuscationFileTypeUnspecified" | "proguard" | "nativeCode"; } /** * Responses for the upload. */ export interface DeobfuscationFilesUploadResponse { /** * The uploaded Deobfuscation File configuration. */ deobfuscationFile?: DeobfuscationFile; } /** * Request message for DeployAppRecovery. */ export interface DeployAppRecoveryRequest { } /** * Response message for DeployAppRecovery. */ export interface DeployAppRecoveryResponse { } /** * Developer entry from conversation between user and developer. */ export interface DeveloperComment { /** * The last time at which this comment was updated. */ lastModified?: Timestamp; /** * The content of the comment, i.e. reply body. */ text?: string; } function serializeDeveloperComment(data: any): DeveloperComment { return { ...data, lastModified: data["lastModified"] !== undefined ? serializeTimestamp(data["lastModified"]) : undefined, }; } function deserializeDeveloperComment(data: any): DeveloperComment { return { ...data, lastModified: data["lastModified"] !== undefined ? deserializeTimestamp(data["lastModified"]) : undefined, }; } /** * Information specific to cancellations initiated by developers. */ export interface DeveloperInitiatedCancellation { } /** * Represents a device feature. */ export interface DeviceFeature { /** * Name of the feature. */ featureName?: string; /** * The feature version specified by android:glEsVersion or android:version in * in the AndroidManifest. */ featureVersion?: number; } /** * Targeting for a device feature. */ export interface DeviceFeatureTargeting { /** * Feature of the device. */ requiredFeature?: DeviceFeature; } /** * 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 DeviceGroup { /** * Device selectors for this group. A device matching any of the selectors is * included in this group. */ deviceSelectors?: DeviceSelector[]; /** * The name of the group. */ name?: string; } function serializeDeviceGroup(data: any): DeviceGroup { return { ...data, deviceSelectors: data["deviceSelectors"] !== undefined ? data["deviceSelectors"].map((item: any) => (serializeDeviceSelector(item))) : undefined, }; } function deserializeDeviceGroup(data: any): DeviceGroup { return { ...data, deviceSelectors: data["deviceSelectors"] !== undefined ? data["deviceSelectors"].map((item: any) => (deserializeDeviceSelector(item))) : undefined, }; } /** * Identifier of a device. */ export interface DeviceId { /** * Value of Build.BRAND. */ buildBrand?: string; /** * Value of Build.DEVICE. */ buildDevice?: string; } /** * Characteristics of the user's device. */ export interface DeviceMetadata { /** * Device CPU make, e.g. "Qualcomm" */ cpuMake?: string; /** * Device CPU model, e.g. "MSM8974" */ cpuModel?: string; /** * Device class (e.g. tablet) */ deviceClass?: string; /** * OpenGL version */ glEsVersion?: number; /** * Device manufacturer (e.g. Motorola) */ manufacturer?: string; /** * Comma separated list of native platforms (e.g. "arm", "arm7") */ nativePlatform?: string; /** * Device model name (e.g. Droid) */ productName?: string; /** * Device RAM in Megabytes, e.g. "2048" */ ramMb?: number; /** * Screen density in DPI */ screenDensityDpi?: number; /** * Screen height in pixels */ screenHeightPx?: number; /** * Screen width in pixels */ screenWidthPx?: number; } /** * Conditions about a device's RAM capabilities. */ export interface DeviceRam { /** * Maximum RAM in bytes (bound excluded). */ maxBytes?: bigint; /** * Minimum RAM in bytes (bound included). */ minBytes?: bigint; } function serializeDeviceRam(data: any): DeviceRam { return { ...data, maxBytes: data["maxBytes"] !== undefined ? String(data["maxBytes"]) : undefined, minBytes: data["minBytes"] !== undefined ? String(data["minBytes"]) : undefined, }; } function deserializeDeviceRam(data: any): DeviceRam { return { ...data, maxBytes: data["maxBytes"] !== undefined ? BigInt(data["maxBytes"]) : undefined, minBytes: data["minBytes"] !== undefined ? BigInt(data["minBytes"]) : undefined, }; } /** * 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 DeviceSelector { /** * Conditions on the device's RAM. */ deviceRam?: DeviceRam; /** * Device models excluded by this selector, even if they match all other * conditions. */ excludedDeviceIds?: DeviceId[]; /** * A device that has any of these system features is excluded by this * selector, even if it matches all other conditions. */ forbiddenSystemFeatures?: SystemFeature[]; /** * Device models included by this selector. */ includedDeviceIds?: DeviceId[]; /** * A device needs to have all these system features to be included by the * selector. */ requiredSystemFeatures?: SystemFeature[]; /** * Optional. The SoCs included by this selector. Only works for Android S+ * devices. */ systemOnChips?: SystemOnChip[]; } function serializeDeviceSelector(data: any): DeviceSelector { return { ...data, deviceRam: data["deviceRam"] !== undefined ? serializeDeviceRam(data["deviceRam"]) : undefined, }; } function deserializeDeviceSelector(data: any): DeviceSelector { return { ...data, deviceRam: data["deviceRam"] !== undefined ? deserializeDeviceRam(data["deviceRam"]) : undefined, }; } /** * The device spec used to generate a system APK. */ export interface DeviceSpec { /** * Screen dpi. */ screenDensity?: number; /** * Supported ABI architectures in the order of preference. The values should * be the string as reported by the platform, e.g. "armeabi-v7a", "x86_64". */ supportedAbis?: string[]; /** * All installed locales represented as BCP-47 strings, e.g. "en-US". */ supportedLocales?: string[]; } /** * A single device tier. Devices matching any of the device groups in * device_group_names are considered to match the tier. */ export interface DeviceTier { /** * Groups of devices included in this tier. These groups must be defined * explicitly under device_groups in this configuration. */ deviceGroupNames?: string[]; /** * 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; } /** * Configuration describing device targeting criteria for the content of an * app. */ export interface DeviceTierConfig { /** * Definition of device groups for the app. */ deviceGroups?: DeviceGroup[]; /** * Output only. The device tier config ID. */ readonly deviceTierConfigId?: bigint; /** * Definition of the set of device tiers for the app. */ deviceTierSet?: DeviceTierSet; /** * Definition of user country sets for the app. */ userCountrySets?: UserCountrySet[]; } function serializeDeviceTierConfig(data: any): DeviceTierConfig { return { ...data, deviceGroups: data["deviceGroups"] !== undefined ? data["deviceGroups"].map((item: any) => (serializeDeviceGroup(item))) : undefined, }; } function deserializeDeviceTierConfig(data: any): DeviceTierConfig { return { ...data, deviceGroups: data["deviceGroups"] !== undefined ? data["deviceGroups"].map((item: any) => (deserializeDeviceGroup(item))) : undefined, deviceTierConfigId: data["deviceTierConfigId"] !== undefined ? BigInt(data["deviceTierConfigId"]) : undefined, }; } /** * 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 DeviceTierSet { /** * Device tiers belonging to the set. */ deviceTiers?: DeviceTier[]; } /** * Additional options for Androidpublisher#editsBundlesUpload. */ export interface EditsBundlesUploadOptions { /** * Deprecated. The installation warning has been removed, it's not necessary * to set this field anymore. */ ackBundleInstallationWarning?: boolean; /** * Device tier config (DTC) to be used for generating deliverables (APKs). * Contains id of the DTC or "LATEST" for last uploaded DTC. */ deviceTierConfigId?: string; } /** * Additional options for Androidpublisher#editsCommit. */ export interface EditsCommitOptions { /** * 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. */ changesNotSentForReview?: boolean; } /** * An expansion file. The resource for ExpansionFilesService. */ export interface ExpansionFile { /** * If set, this field indicates that this APK has an expansion file uploaded * to it: this APK does not reference another APK's expansion file. The * field's value is the size of the uploaded expansion file in bytes. */ fileSize?: bigint; /** * If set, this APK's expansion file references another APK's expansion file. * The file_size field will not be set. */ referencesVersion?: number; } function serializeExpansionFile(data: any): ExpansionFile { return { ...data, fileSize: data["fileSize"] !== undefined ? String(data["fileSize"]) : undefined, }; } function deserializeExpansionFile(data: any): ExpansionFile { return { ...data, fileSize: data["fileSize"] !== undefined ? BigInt(data["fileSize"]) : undefined, }; } /** * Response for uploading an expansion file. */ export interface ExpansionFilesUploadResponse { /** * The uploaded expansion file configuration. */ expansionFile?: ExpansionFile; } function serializeExpansionFilesUploadResponse(data: any): ExpansionFilesUploadResponse { return { ...data, expansionFile: data["expansionFile"] !== undefined ? serializeExpansionFile(data["expansionFile"]) : undefined, }; } function deserializeExpansionFilesUploadResponse(data: any): ExpansionFilesUploadResponse { return { ...data, expansionFile: data["expansionFile"] !== undefined ? deserializeExpansionFile(data["expansionFile"]) : undefined, }; } /** * User account identifier in the third-party service. */ export interface ExternalAccountIdentifiers { /** * User account identifier in the third-party service. Only present if * account linking happened as part of the subscription purchase flow. */ externalAccountId?: string; /** * 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; /** * 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; } /** * 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. */ export interface ExternallyHostedApk { /** * The application label. */ applicationLabel?: string; /** * A certificate (or array of certificates if a certificate-chain is used) * used to sign this APK, represented as a base64 encoded byte array. */ certificateBase64s?: string[]; /** * The URL at which the APK is hosted. This must be an https URL. */ externallyHostedUrl?: string; /** * The sha1 checksum of this APK, represented as a base64 encoded byte array. */ fileSha1Base64?: string; /** * The sha256 checksum of this APK, represented as a base64 encoded byte * array. */ fileSha256Base64?: string; /** * The file size in bytes of this APK. */ fileSize?: bigint; /** * The icon image from the APK, as a base64 encoded byte array. */ iconBase64?: string; /** * The maximum SDK supported by this APK (optional). */ maximumSdk?: number; /** * The minimum SDK targeted by this APK. */ minimumSdk?: number; /** * The native code environments supported by this APK (optional). */ nativeCodes?: string[]; /** * The package name. */ packageName?: string; /** * The features required by this APK (optional). */ usesFeatures?: string[]; /** * The permissions requested by this APK. */ usesPermissions?: UsesPermission[]; /** * The version code of this APK. */ versionCode?: number; /** * The version name of this APK. */ versionName?: string; } function serializeExternallyHostedApk(data: any): ExternallyHostedApk { return { ...data, fileSize: data["fileSize"] !== undefined ? String(data["fileSize"]) : undefined, }; } function deserializeExternallyHostedApk(data: any): ExternallyHostedApk { return { ...data, fileSize: data["fileSize"] !== undefined ? BigInt(data["fileSize"]) : undefined, }; } /** * Details of an external subscription. */ export interface ExternalSubscription { /** * Required. The type of the external subscription. */ subscriptionType?: | "SUBSCRIPTION_TYPE_UNSPECIFIED" | "RECURRING" | "PREPAID"; } /** * The details of an external transaction. */ export interface ExternalTransaction { /** * Output only. The time when this transaction was created. This is the time * when Google was notified of the transaction. */ readonly createTime?: Date; /** * Output only. The current transaction amount before tax. This represents * the current pre-tax amount including any refunds that may have been applied * to this transaction. */ readonly currentPreTaxAmount?: Price; /** * Output only. The current tax amount. This represents the current tax * amount including any refunds that may have been applied to this * transaction. */ readonly currentTaxAmount?: Price; /** * Output only. The id of this transaction. All transaction ids under the * same package name must be unique. Set when creating the external * transaction. */ readonly externalTransactionId?: string; /** * This is a one-time transaction and not part of a subscription. */ oneTimeTransaction?: OneTimeExternalTransaction; /** * Required. The original transaction amount before taxes. This represents * the pre-tax amount originally notified to Google before any refunds were * applied. */ originalPreTaxAmount?: Price; /** * Required. The original tax amount. This represents the tax amount * originally notified to Google before any refunds were applied. */ originalTaxAmount?: Price; /** * Output only. The resource name of the external transaction. The package * name of the application the inapp products were sold (for example, * 'com.some.app'). */ readonly packageName?: string; /** * This transaction is part of a recurring series of transactions. */ recurringTransaction?: RecurringExternalTransaction; /** * Output only. If set, this transaction was a test purchase. Google will not * charge for a test transaction. */ readonly testPurchase?: ExternalTransactionTestPurchase; /** * Optional. The transaction program code, used to help determine service fee * for eligible apps participating in partner programs. Developers * participating in the Play Media Experience Program * (https://play.google.com/console/about/programs/mediaprogram/) must provide * the program code when reporting alternative billing transactions. If you * are an eligible developer, please contact your BDM for more information on * how to set this field. Note: this field can not be used for external offers * transactions. */ transactionProgramCode?: number; /** * Output only. The current state of the transaction. */ readonly transactionState?: | "TRANSACTION_STATE_UNSPECIFIED" | "TRANSACTION_REPORTED" | "TRANSACTION_CANCELED"; /** * Required. The time when the transaction was completed. */ transactionTime?: Date; /** * Required. User address for tax computation. */ userTaxAddress?: ExternalTransactionAddress; } function serializeExternalTransaction(data: any): ExternalTransaction { return { ...data, transactionTime: data["transactionTime"] !== undefined ? data["transactionTime"].toISOString() : undefined, }; } function deserializeExternalTransaction(data: any): ExternalTransaction { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, transactionTime: data["transactionTime"] !== undefined ? new Date(data["transactionTime"]) : undefined, }; } /** * User's address for the external transaction. */ export interface ExternalTransactionAddress { /** * Optional. Top-level administrative subdivision of the country/region. Only * required for transactions in India. Valid values are "ANDAMAN AND NICOBAR * ISLANDS", "ANDHRA PRADESH", "ARUNACHAL PRADESH", "ASSAM", "BIHAR", * "CHANDIGARH", "CHHATTISGARH", "DADRA AND NAGAR HAVELI", "DADRA AND NAGAR * HAVELI AND DAMAN AND DIU", "DAMAN AND DIU", "DELHI", "GOA", "GUJARAT", * "HARYANA", "HIMACHAL PRADESH", "JAMMU AND KASHMIR", "JHARKHAND", * "KARNATAKA", "KERALA", "LADAKH", "LAKSHADWEEP", "MADHYA PRADESH", * "MAHARASHTRA", "MANIPUR", "MEGHALAYA", "MIZORAM", "NAGALAND", "ODISHA", * "PUDUCHERRY", "PUNJAB", "RAJASTHAN", "SIKKIM", "TAMIL NADU", "TELANGANA", * "TRIPURA", "UTTAR PRADESH", "UTTARAKHAND", and "WEST BENGAL". */ administrativeArea?: string; /** * Required. Two letter region code based on ISO-3166-1 Alpha-2 (UN region * codes). */ regionCode?: string; } /** * Additional options for * Androidpublisher#externaltransactionsCreateexternaltransaction. */ export interface ExternaltransactionsCreateexternaltransactionOptions { /** * Required. The id to use for the external transaction. Must be unique * across all other transactions for the app. This value should be 1-63 * characters and valid characters are /a-zA-Z0-9_-/. Do not use this field to * store any Personally Identifiable Information (PII) such as emails. * Attempting to store PII in this field may result in requests being blocked. */ externalTransactionId?: string; } /** * Represents a transaction performed using a test account. These transactions * will not be charged by Google. */ export interface ExternalTransactionTestPurchase { } /** * A full refund of the remaining amount of a transaction. */ export interface FullRefund { } /** * Response to list generated APKs. */ export interface GeneratedApksListResponse { /** * All generated APKs, grouped by the APK signing key. */ generatedApks?: GeneratedApksPerSigningKey[]; } function serializeGeneratedApksListResponse(data: any): GeneratedApksListResponse { return { ...data, generatedApks: data["generatedApks"] !== undefined ? data["generatedApks"].map((item: any) => (serializeGeneratedApksPerSigningKey(item))) : undefined, }; } function deserializeGeneratedApksListResponse(data: any): GeneratedApksListResponse { return { ...data, generatedApks: data["generatedApks"] !== undefined ? data["generatedApks"].map((item: any) => (deserializeGeneratedApksPerSigningKey(item))) : undefined, }; } /** * Download metadata for split, standalone and universal APKs, as well as asset * pack slices, signed with a given key. */ export interface GeneratedApksPerSigningKey { /** * SHA256 hash of the APK signing public key certificate. */ certificateSha256Hash?: string; /** * List of asset pack slices which will be served for this app bundle, signed * with a key corresponding to certificate_sha256_hash. */ generatedAssetPackSlices?: GeneratedAssetPackSlice[]; /** * Generated recovery apks for recovery actions signed with a key * corresponding to certificate_sha256_hash. This includes all generated * recovery APKs, also those in draft or cancelled state. This field is not * set if no recovery actions were created for this signing key. */ generatedRecoveryModules?: GeneratedRecoveryApk[]; /** * List of generated split APKs, signed with a key corresponding to * certificate_sha256_hash. */ generatedSplitApks?: GeneratedSplitApk[]; /** * List of generated standalone APKs, signed with a key corresponding to * certificate_sha256_hash. */ generatedStandaloneApks?: GeneratedStandaloneApk[]; /** * Generated universal APK, signed with a key corresponding to * certificate_sha256_hash. This field is not set if no universal APK was * generated for this signing key. */ generatedUniversalApk?: GeneratedUniversalApk; /** * Contains targeting information about the generated apks. */ targetingInfo?: TargetingInfo; } function serializeGeneratedApksPerSigningKey(data: any): GeneratedApksPerSigningKey { return { ...data, generatedAssetPackSlices: data["generatedAssetPackSlices"] !== undefined ? data["generatedAssetPackSlices"].map((item: any) => (serializeGeneratedAssetPackSlice(item))) : undefined, generatedRecoveryModules: data["generatedRecoveryModules"] !== undefined ? data["generatedRecoveryModules"].map((item: any) => (serializeGeneratedRecoveryApk(item))) : undefined, }; } function deserializeGeneratedApksPerSigningKey(data: any): GeneratedApksPerSigningKey { return { ...data, generatedAssetPackSlices: data["generatedAssetPackSlices"] !== undefined ? data["generatedAssetPackSlices"].map((item: any) => (deserializeGeneratedAssetPackSlice(item))) : undefined, generatedRecoveryModules: data["generatedRecoveryModules"] !== undefined ? data["generatedRecoveryModules"].map((item: any) => (deserializeGeneratedRecoveryApk(item))) : undefined, }; } /** * Download metadata for an asset pack slice. */ export interface GeneratedAssetPackSlice { /** * Download ID, which uniquely identifies the APK to download. Should be * supplied to `generatedapks.download` method. */ downloadId?: string; /** * Name of the module that this asset slice belongs to. */ moduleName?: string; /** * Asset slice ID. */ sliceId?: string; /** * Asset module version. */ version?: bigint; } function serializeGeneratedAssetPackSlice(data: any): GeneratedAssetPackSlice { return { ...data, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeGeneratedAssetPackSlice(data: any): GeneratedAssetPackSlice { return { ...data, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } /** * Download metadata for an app recovery module. */ export interface GeneratedRecoveryApk { /** * Download ID, which uniquely identifies the APK to download. Should be * supplied to `generatedapks.download` method. */ downloadId?: string; /** * Name of the module which recovery apk belongs to. */ moduleName?: string; /** * ID of the recovery action. */ recoveryId?: bigint; /** * The status of the recovery action corresponding to the recovery apk. */ recoveryStatus?: | "RECOVERY_STATUS_UNSPECIFIED" | "RECOVERY_STATUS_ACTIVE" | "RECOVERY_STATUS_CANCELED" | "RECOVERY_STATUS_DRAFT" | "RECOVERY_STATUS_GENERATION_IN_PROGRESS" | "RECOVERY_STATUS_GENERATION_FAILED"; } function serializeGeneratedRecoveryApk(data: any): GeneratedRecoveryApk { return { ...data, recoveryId: data["recoveryId"] !== undefined ? String(data["recoveryId"]) : undefined, }; } function deserializeGeneratedRecoveryApk(data: any): GeneratedRecoveryApk { return { ...data, recoveryId: data["recoveryId"] !== undefined ? BigInt(data["recoveryId"]) : undefined, }; } /** * Download metadata for a split APK. */ export interface GeneratedSplitApk { /** * Download ID, which uniquely identifies the APK to download. Should be * supplied to `generatedapks.download` method. */ downloadId?: string; /** * Name of the module that this APK belongs to. */ moduleName?: string; /** * Split ID. Empty for the main split of the base module. */ splitId?: string; /** * ID of the generated variant. */ variantId?: number; } /** * Download metadata for a standalone APK. */ export interface GeneratedStandaloneApk { /** * Download ID, which uniquely identifies the APK to download. Should be * supplied to `generatedapks.download` method. */ downloadId?: string; /** * ID of the generated variant. */ variantId?: number; } /** * Download metadata for a universal APK. */ export interface GeneratedUniversalApk { /** * Download ID, which uniquely identifies the APK to download. Should be * supplied to `generatedapks.download` method. */ downloadId?: string; } /** * Request message for GetSubscriptionOffer. */ export interface GetSubscriptionOfferRequest { /** * Required. The parent base plan (ID) of the offer to get. */ basePlanId?: string; /** * Required. The unique offer ID of the offer to get. */ offerId?: string; /** * Required. The parent app (package name) of the offer to get. */ packageName?: string; /** * Required. The parent subscription (ID) of the offer to get. */ productId?: string; } /** * An access grant resource. */ export interface Grant { /** * The permissions granted to the user for this app. */ appLevelPermissions?: | "APP_LEVEL_PERMISSION_UNSPECIFIED" | "CAN_ACCESS_APP" | "CAN_VIEW_FINANCIAL_DATA" | "CAN_MANAGE_PERMISSIONS" | "CAN_REPLY_TO_REVIEWS" | "CAN_MANAGE_PUBLIC_APKS" | "CAN_MANAGE_TRACK_APKS" | "CAN_MANAGE_TRACK_USERS" | "CAN_MANAGE_PUBLIC_LISTING" | "CAN_MANAGE_DRAFT_APPS" | "CAN_MANAGE_ORDERS" | "CAN_MANAGE_APP_CONTENT" | "CAN_VIEW_NON_FINANCIAL_DATA" | "CAN_VIEW_APP_QUALITY" | "CAN_MANAGE_DEEPLINKS"[]; /** * 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. */ name?: string; /** * Immutable. The package name of the app. This will be empty for draft apps. */ packageName?: string; } /** * Additional options for Androidpublisher#grantsPatch. */ export interface GrantsPatchOptions { /** * Optional. The list of fields to be updated. */ updateMask?: string /* FieldMask */; } function serializeGrantsPatchOptions(data: any): GrantsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeGrantsPatchOptions(data: any): GrantsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * An uploaded image. The resource for ImagesService. */ export interface Image { /** * A unique id representing this image. */ id?: string; /** * A sha1 hash of the image. */ sha1?: string; /** * A sha256 hash of the image. */ sha256?: string; /** * A URL that will serve a preview of the image. */ url?: string; } /** * Response for deleting all images. */ export interface ImagesDeleteAllResponse { /** * The deleted images. */ deleted?: Image[]; } /** * Response listing all images. */ export interface ImagesListResponse { /** * All listed Images. */ images?: Image[]; } /** * Response for uploading an image. */ export interface ImagesUploadResponse { /** * The uploaded image. */ image?: Image; } /** * An in-app product. The resource for InappproductsService. */ export interface InAppProduct { /** * Default language of the localized data, as defined by BCP-47. e.g. * "en-US". */ defaultLanguage?: string; /** * Default price. Cannot be zero, as in-app products are never free. Always * in the developer's Checkout merchant currency. */ defaultPrice?: Price; /** * Grace period of the subscription, specified in ISO 8601 format. Allows * developers to give their subscribers a grace period when the payment for * the new recurrence period is declined. Acceptable values are P0D (zero * days), P3D (three days), P7D (seven days), P14D (14 days), and P30D (30 * days). */ gracePeriod?: string; /** * List of localized title and description data. Map key is the language of * the localized data, as defined by BCP-47, e.g. "en-US". */ listings?: { [key: string]: InAppProductListing }; /** * Details about taxes and legal compliance. Only applicable to managed * products. */ managedProductTaxesAndComplianceSettings?: ManagedProductTaxAndComplianceSettings; /** * Package name of the parent app. */ packageName?: string; /** * Prices per buyer region. None of these can be zero, as in-app products are * never free. Map key is region code, as defined by ISO 3166-2. */ prices?: { [key: string]: Price }; /** * The type of the product, e.g. a recurring subscription. */ purchaseType?: | "purchaseTypeUnspecified" | "managedUser" | "subscription"; /** * Stock-keeping-unit (SKU) of the product, unique within an app. */ sku?: string; /** * The status of the product, e.g. whether it's active. */ status?: | "statusUnspecified" | "active" | "inactive"; /** * Subscription period, specified in ISO 8601 format. Acceptable values are * P1W (one week), P1M (one month), P3M (three months), P6M (six months), and * P1Y (one year). */ subscriptionPeriod?: string; /** * Details about taxes and legal compliance. Only applicable to subscription * products. */ subscriptionTaxesAndComplianceSettings?: SubscriptionTaxAndComplianceSettings; /** * Trial period, specified in ISO 8601 format. Acceptable values are anything * between P7D (seven days) and P999D (999 days). */ trialPeriod?: string; } /** * Store listing of a single in-app product. */ export interface InAppProductListing { /** * Localized entitlement benefits for a subscription. */ benefits?: string[]; /** * Description for the store listing. */ description?: string; /** * Title for the store listing. */ title?: string; } /** * Request to delete multiple in-app products. */ export interface InappproductsBatchDeleteRequest { /** * Individual delete requests. At least one request is required. Can contain * up to 100 requests. All requests must correspond to different in-app * products. */ requests?: InappproductsDeleteRequest[]; } /** * Additional options for Androidpublisher#inappproductsBatchGet. */ export interface InappproductsBatchGetOptions { /** * Unique identifier for the in-app products. */ sku?: string; } /** * Response message for BatchGetSubscriptions endpoint. */ export interface InappproductsBatchGetResponse { /** * The list of requested in-app products, in the same order as the request. */ inappproduct?: InAppProduct[]; } /** * Request to update or insert one or more in-app products. */ export interface InappproductsBatchUpdateRequest { /** * Required. Individual update requests. At least one request is required. * Can contain up to 100 requests. All requests must correspond to different * in-app products. */ requests?: InappproductsUpdateRequest[]; } /** * Response for a batch in-app product update. */ export interface InappproductsBatchUpdateResponse { /** * The updated or inserted in-app products. */ inappproducts?: InAppProduct[]; } /** * Additional options for Androidpublisher#inappproductsDelete. */ export interface InappproductsDeleteOptions { /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; } /** * Request to delete an in-app product. */ export interface InappproductsDeleteRequest { /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Package name of the app. */ packageName?: string; /** * Unique identifier for the in-app product. */ sku?: string; } /** * Additional options for Androidpublisher#inappproductsInsert. */ export interface InappproductsInsertOptions { /** * 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. */ autoConvertMissingPrices?: boolean; } /** * Additional options for Androidpublisher#inappproductsList. */ export interface InappproductsListOptions { /** * Deprecated and ignored. The page size is determined by the server. */ maxResults?: number; /** * Deprecated and ignored. Set the `token` parameter to retrieve the next * page. */ startIndex?: number; /** * Pagination token. If empty, list starts at the first product. */ token?: string; } /** * Response listing all in-app products. */ export interface InappproductsListResponse { /** * All in-app products. */ inappproduct?: InAppProduct[]; /** * The kind of this response ("androidpublisher#inappproductsListResponse"). */ kind?: string; /** * Deprecated and unset. */ pageInfo?: PageInfo; /** * Pagination token, to handle a number of products that is over one page. */ tokenPagination?: TokenPagination; } /** * Additional options for Androidpublisher#inappproductsPatch. */ export interface InappproductsPatchOptions { /** * 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. */ autoConvertMissingPrices?: boolean; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; } /** * Additional options for Androidpublisher#inappproductsUpdate. */ export interface InappproductsUpdateOptions { /** * 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. */ allowMissing?: boolean; /** * 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. */ autoConvertMissingPrices?: boolean; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; } /** * Request to update an in-app product. */ export interface InappproductsUpdateRequest { /** * 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. */ allowMissing?: boolean; /** * 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. */ autoConvertMissingPrices?: boolean; /** * The new in-app product. */ inappproduct?: InAppProduct; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Package name of the app. */ packageName?: string; /** * Unique identifier for the in-app product. */ sku?: string; } /** * Information to a installment plan. */ export interface InstallmentPlan { /** * Total number of payments the user is initially committed for. */ initialCommittedPaymentsCount?: number; /** * If present, this installment plan is pending to be canceled. The * cancellation will happen only after the user finished all committed * payments. */ pendingCancellation?: PendingCancellation; /** * Total number of committed payments remaining to be paid for in this * renewal cycle. */ remainingCommittedPaymentsCount?: number; /** * Total number of payments the user will be committed for after each * commitment period. Empty means the installment plan will fall back to a * normal auto-renew subscription after initial commitment. */ subsequentCommittedPaymentsCount?: number; } /** * Represents an installments base plan where a user commits to a specified * number of payments. */ export interface InstallmentsBasePlanType { /** * Optional. Account hold period of the subscription, specified exclusively * in days and in ISO 8601 format. Acceptable values are P0D (zero days) to * P30D (30days). If not specified, the default value is P30D (30 days). */ accountHoldDuration?: string; /** * Required. Immutable. Subscription period, specified in ISO 8601 format. * For a list of acceptable billing periods, refer to the help center. The * duration is immutable after the base plan is created. */ billingPeriodDuration?: string; /** * Required. Immutable. The number of payments the user is committed to. It * is immutable after the base plan is created. */ committedPaymentsCount?: number; /** * 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; /** * 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. */ prorationMode?: | "SUBSCRIPTION_PRORATION_MODE_UNSPECIFIED" | "SUBSCRIPTION_PRORATION_MODE_CHARGE_ON_NEXT_BILLING_DATE" | "SUBSCRIPTION_PRORATION_MODE_CHARGE_FULL_PRICE_IMMEDIATELY"; /** * Required. Immutable. Installments base plan renewal type. Determines the * behavior at the end of the initial commitment. The renewal type is * immutable after the base plan is created. */ renewalType?: | "RENEWAL_TYPE_UNSPECIFIED" | "RENEWAL_TYPE_RENEWS_WITHOUT_COMMITMENT" | "RENEWAL_TYPE_RENEWS_WITH_COMMITMENT"; /** * Whether users should be able to resubscribe to this base plan in Google * Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified. */ resubscribeState?: | "RESUBSCRIBE_STATE_UNSPECIFIED" | "RESUBSCRIBE_STATE_ACTIVE" | "RESUBSCRIBE_STATE_INACTIVE"; } /** * An artifact resource which gets created when uploading an APK or Android App * Bundle through internal app sharing. */ export interface InternalAppSharingArtifact { /** * The sha256 fingerprint of the certificate used to sign the generated * artifact. */ certificateFingerprint?: string; /** * The download URL generated for the uploaded artifact. Users that are * authorized to download can follow the link to the Play Store app to install * it. */ downloadUrl?: string; /** * The sha256 hash of the artifact represented as a lowercase hexadecimal * number, matching the output of the sha256sum command. */ sha256?: string; } /** * Contains the introductory price information for a subscription. */ export interface IntroductoryPriceInfo { /** * Introductory price of the subscription, not including tax. The currency is * the same as price_currency_code. 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. */ introductoryPriceAmountMicros?: bigint; /** * ISO 4217 currency code for the introductory subscription price. For * example, if the price is specified in British pounds sterling, * price_currency_code is "GBP". */ introductoryPriceCurrencyCode?: string; /** * The number of billing period to offer introductory pricing. */ introductoryPriceCycles?: number; /** * Introductory price period, specified in ISO 8601 format. Common values are * (but not limited to) "P1W" (one week), "P1M" (one month), "P3M" (three * months), "P6M" (six months), and "P1Y" (one year). */ introductoryPricePeriod?: string; } function serializeIntroductoryPriceInfo(data: any): IntroductoryPriceInfo { return { ...data, introductoryPriceAmountMicros: data["introductoryPriceAmountMicros"] !== undefined ? String(data["introductoryPriceAmountMicros"]) : undefined, }; } function deserializeIntroductoryPriceInfo(data: any): IntroductoryPriceInfo { return { ...data, introductoryPriceAmountMicros: data["introductoryPriceAmountMicros"] !== undefined ? BigInt(data["introductoryPriceAmountMicros"]) : undefined, }; } /** * Targeting based on language. */ export interface LanguageTargeting { /** * Alternative languages. */ alternatives?: string[]; /** * ISO-639: 2 or 3 letter language code. */ value?: string[]; } /** * Response message for ListAppRecoveries. -- api-linter: * core::0158::response-next-page-token-field=disabled */ export interface ListAppRecoveriesResponse { /** * List of recovery actions associated with the requested package name. */ recoveryActions?: AppRecoveryAction[]; } function serializeListAppRecoveriesResponse(data: any): ListAppRecoveriesResponse { return { ...data, recoveryActions: data["recoveryActions"] !== undefined ? data["recoveryActions"].map((item: any) => (serializeAppRecoveryAction(item))) : undefined, }; } function deserializeListAppRecoveriesResponse(data: any): ListAppRecoveriesResponse { return { ...data, recoveryActions: data["recoveryActions"] !== undefined ? data["recoveryActions"].map((item: any) => (deserializeAppRecoveryAction(item))) : undefined, }; } /** * Response listing existing device tier configs. */ export interface ListDeviceTierConfigsResponse { /** * Device tier configs created by the developer. */ deviceTierConfigs?: 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; } function serializeListDeviceTierConfigsResponse(data: any): ListDeviceTierConfigsResponse { return { ...data, deviceTierConfigs: data["deviceTierConfigs"] !== undefined ? data["deviceTierConfigs"].map((item: any) => (serializeDeviceTierConfig(item))) : undefined, }; } function deserializeListDeviceTierConfigsResponse(data: any): ListDeviceTierConfigsResponse { return { ...data, deviceTierConfigs: data["deviceTierConfigs"] !== undefined ? data["deviceTierConfigs"].map((item: any) => (deserializeDeviceTierConfig(item))) : undefined, }; } /** * A localized store listing. The resource for ListingsService. */ export interface Listing { /** * Full description of the app. */ fullDescription?: string; /** * Language localization code (a BCP-47 language tag; for example, "de-AT" * for Austrian German). */ language?: string; /** * Short description of the app. */ shortDescription?: string; /** * Localized title of the app. */ title?: string; /** * URL of a promotional YouTube video for the app. */ video?: string; } /** * Response listing all localized listings. */ export interface ListingsListResponse { /** * The kind of this response ("androidpublisher#listingsListResponse"). */ kind?: string; /** * All localized listings. */ listings?: Listing[]; } /** * Response message for ListSubscriptionOffers. */ export interface ListSubscriptionOffersResponse { /** * 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; /** * The subscription offers from the specified subscription. */ subscriptionOffers?: SubscriptionOffer[]; } function serializeListSubscriptionOffersResponse(data: any): ListSubscriptionOffersResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (serializeSubscriptionOffer(item))) : undefined, }; } function deserializeListSubscriptionOffersResponse(data: any): ListSubscriptionOffersResponse { return { ...data, subscriptionOffers: data["subscriptionOffers"] !== undefined ? data["subscriptionOffers"].map((item: any) => (deserializeSubscriptionOffer(item))) : undefined, }; } /** * Response message for ListSubscriptions. */ export interface ListSubscriptionsResponse { /** * 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; /** * The subscriptions from the specified app. */ subscriptions?: Subscription[]; } function serializeListSubscriptionsResponse(data: any): ListSubscriptionsResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (serializeSubscription(item))) : undefined, }; } function deserializeListSubscriptionsResponse(data: any): ListSubscriptionsResponse { return { ...data, subscriptions: data["subscriptions"] !== undefined ? data["subscriptions"].map((item: any) => (deserializeSubscription(item))) : undefined, }; } /** * A response containing one or more users with access to an account. */ export interface ListUsersResponse { /** * 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; /** * The resulting users. */ users?: User[]; } function serializeListUsersResponse(data: any): ListUsersResponse { return { ...data, users: data["users"] !== undefined ? data["users"].map((item: any) => (serializeUser(item))) : undefined, }; } function deserializeListUsersResponse(data: any): ListUsersResponse { return { ...data, users: data["users"] !== undefined ? data["users"].map((item: any) => (deserializeUser(item))) : undefined, }; } /** * Localized text in given language. */ export interface LocalizedText { /** * Language localization code (a BCP-47 language tag; for example, "de-AT" * for Austrian German). */ language?: string; /** * The text in the given language. */ text?: string; } /** * Details about taxation and legal compliance for managed products. */ export interface ManagedProductTaxAndComplianceSettings { /** * 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. */ eeaWithdrawalRightType?: | "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" | "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" | "WITHDRAWAL_RIGHT_SERVICE"; /** * Whether this in-app product is declared as a product representing a * tokenized digital asset. */ isTokenizedDigitalAsset?: boolean; /** * A mapping from region code to tax rate details. The keys are region codes * as defined by Unicode's "CLDR". */ taxRateInfoByRegionCode?: { [key: string]: RegionalTaxRateInfo }; } /** * Request message for MigrateBasePlanPrices. */ export interface MigrateBasePlanPricesRequest { /** * Required. The unique base plan ID of the base plan to update prices on. */ basePlanId?: string; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. Package name of the parent app. Must be equal to the * package_name field on the Subscription resource. */ packageName?: string; /** * Required. The ID of the subscription to update. Must be equal to the * product_id field on the Subscription resource. */ productId?: string; /** * Required. The regional prices to update. */ regionalPriceMigrations?: RegionalPriceMigrationConfig[]; /** * Required. The version of the available regions being used for the * regional_price_migrations. */ regionsVersion?: RegionsVersion; } function serializeMigrateBasePlanPricesRequest(data: any): MigrateBasePlanPricesRequest { return { ...data, regionalPriceMigrations: data["regionalPriceMigrations"] !== undefined ? data["regionalPriceMigrations"].map((item: any) => (serializeRegionalPriceMigrationConfig(item))) : undefined, }; } function deserializeMigrateBasePlanPricesRequest(data: any): MigrateBasePlanPricesRequest { return { ...data, regionalPriceMigrations: data["regionalPriceMigrations"] !== undefined ? data["regionalPriceMigrations"].map((item: any) => (deserializeRegionalPriceMigrationConfig(item))) : undefined, }; } /** * Response message for MigrateBasePlanPrices. */ export interface MigrateBasePlanPricesResponse { } /** * Metadata of a module. */ export interface ModuleMetadata { /** * Indicates the delivery type (e.g. on-demand) of the module. */ deliveryType?: | "UNKNOWN_DELIVERY_TYPE" | "INSTALL_TIME" | "ON_DEMAND" | "FAST_FOLLOW"; /** * Names of the modules that this module directly depends on. Each module * implicitly depends on the base module. */ dependencies?: string[]; /** * Indicates the type of this feature module. */ moduleType?: | "UNKNOWN_MODULE_TYPE" | "FEATURE_MODULE"; /** * Module name. */ name?: string; /** * The targeting that makes a conditional module installed. Relevant only for * Split APKs. */ targeting?: ModuleTargeting; } /** * Targeting on the module level. */ export interface ModuleTargeting { /** * Targeting for device features. */ deviceFeatureTargeting?: DeviceFeatureTargeting[]; /** * The sdk version that the variant targets */ sdkVersionTargeting?: SdkVersionTargeting; /** * Countries-level targeting */ userCountriesTargeting?: UserCountriesTargeting; } /** * Additional options for * Androidpublisher#monetizationSubscriptionsBasePlansOffersCreate. */ export interface MonetizationSubscriptionsBasePlansOffersCreateOptions { /** * 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. */ offerId?: string; /** * Required. A string representing the version of available regions being * used for the specified resource. Regional prices for the resource have to * be specified according to the information published in [this * article](https://support.google.com/googleplay/android-developer/answer/10532353). * Each time the supported locations substantially change, the version will be * incremented. Using this field will ensure that creating and updating the * resource with an older region's version and set of regional prices and * currencies will succeed even though a new version is available. The latest * version is 2022/02. */ ["regionsVersion.version"]?: string; } /** * Additional options for * Androidpublisher#monetizationSubscriptionsBasePlansOffersList. */ export interface MonetizationSubscriptionsBasePlansOffersListOptions { /** * 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. */ pageSize?: number; /** * 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. */ pageToken?: string; } /** * Additional options for * Androidpublisher#monetizationSubscriptionsBasePlansOffersPatch. */ export interface MonetizationSubscriptionsBasePlansOffersPatchOptions { /** * Optional. If set to true, and the subscription offer with the given * package_name, product_id, base_plan_id and offer_id doesn't exist, an offer * will be created. If a new offer is created, update_mask is ignored. */ allowMissing?: boolean; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. A string representing the version of available regions being * used for the specified resource. Regional prices for the resource have to * be specified according to the information published in [this * article](https://support.google.com/googleplay/android-developer/answer/10532353). * Each time the supported locations substantially change, the version will be * incremented. Using this field will ensure that creating and updating the * resource with an older region's version and set of regional prices and * currencies will succeed even though a new version is available. The latest * version is 2022/02. */ ["regionsVersion.version"]?: string; /** * Required. The list of fields to be updated. */ updateMask?: string /* FieldMask */; } function serializeMonetizationSubscriptionsBasePlansOffersPatchOptions(data: any): MonetizationSubscriptionsBasePlansOffersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeMonetizationSubscriptionsBasePlansOffersPatchOptions(data: any): MonetizationSubscriptionsBasePlansOffersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for Androidpublisher#monetizationSubscriptionsBatchGet. */ export interface MonetizationSubscriptionsBatchGetOptions { /** * Required. A list of up to 100 subscription product IDs to retrieve. All * the IDs must be different. */ productIds?: string; } /** * Additional options for Androidpublisher#monetizationSubscriptionsCreate. */ export interface MonetizationSubscriptionsCreateOptions { /** * 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. */ productId?: string; /** * Required. A string representing the version of available regions being * used for the specified resource. Regional prices for the resource have to * be specified according to the information published in [this * article](https://support.google.com/googleplay/android-developer/answer/10532353). * Each time the supported locations substantially change, the version will be * incremented. Using this field will ensure that creating and updating the * resource with an older region's version and set of regional prices and * currencies will succeed even though a new version is available. The latest * version is 2022/02. */ ["regionsVersion.version"]?: string; } /** * Additional options for Androidpublisher#monetizationSubscriptionsList. */ export interface MonetizationSubscriptionsListOptions { /** * 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. */ pageSize?: number; /** * 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. */ pageToken?: string; /** * Deprecated: subscription archiving is not supported. */ showArchived?: boolean; } /** * Additional options for Androidpublisher#monetizationSubscriptionsPatch. */ export interface MonetizationSubscriptionsPatchOptions { /** * Optional. If set to true, and the subscription with the given package_name * and product_id doesn't exist, the subscription will be created. If a new * subscription is created, update_mask is ignored. */ allowMissing?: boolean; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. A string representing the version of available regions being * used for the specified resource. Regional prices for the resource have to * be specified according to the information published in [this * article](https://support.google.com/googleplay/android-developer/answer/10532353). * Each time the supported locations substantially change, the version will be * incremented. Using this field will ensure that creating and updating the * resource with an older region's version and set of regional prices and * currencies will succeed even though a new version is available. The latest * version is 2022/02. */ ["regionsVersion.version"]?: string; /** * Required. The list of fields to be updated. */ updateMask?: string /* FieldMask */; } function serializeMonetizationSubscriptionsPatchOptions(data: any): MonetizationSubscriptionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeMonetizationSubscriptionsPatchOptions(data: any): MonetizationSubscriptionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Represents an amount of money with its currency type. */ export interface Money { /** * The three-letter currency code defined in ISO 4217. */ currencyCode?: string; /** * Number of nano (10^-9) units of the amount. The value must be between * -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` * must be positive or zero. If `units` is zero, `nanos` can be positive, * zero, or negative. If `units` is negative, `nanos` must be negative or * zero. For example $-1.75 is represented as `units`=-1 and * `nanos`=-750,000,000. */ nanos?: number; /** * The whole units of the amount. For example if `currencyCode` is `"USD"`, * then 1 unit is one US dollar. */ units?: bigint; } function serializeMoney(data: any): Money { return { ...data, units: data["units"] !== undefined ? String(data["units"]) : undefined, }; } function deserializeMoney(data: any): Money { return { ...data, units: data["units"] !== undefined ? BigInt(data["units"]) : undefined, }; } /** * Represents a list of ABIs. */ export interface MultiAbi { /** * A list of targeted ABIs, as represented by the Android Platform */ abi?: Abi[]; } /** * Targeting based on multiple abis. */ export interface MultiAbiTargeting { /** * Targeting of other sibling directories that were in the Bundle. For main * splits this is targeting of other main splits. */ alternatives?: MultiAbi[]; /** * Value of a multi abi. */ value?: MultiAbi[]; } /** * Offer details information related to a purchase line item. */ export interface OfferDetails { /** * The base plan ID. Present for all base plan and offers. */ basePlanId?: string; /** * The offer ID. Only present for discounted offers. */ offerId?: string; /** * The latest offer tags associated with the offer. It includes tags * inherited from the base plan. */ offerTags?: string[]; } /** * Represents a custom tag specified for base plans and subscription offers. */ export interface OfferTag { /** * 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; } /** * A single use promotion code. */ export interface OneTimeCode { } /** * Represents a one-time transaction. */ export interface OneTimeExternalTransaction { /** * Input only. Provided during the call to Create. Retrieved from the client * when the alternative billing flow is launched. */ externalTransactionToken?: string; } /** * Additional options for Androidpublisher#ordersRefund. */ export interface OrdersRefundOptions { /** * Whether to revoke the purchased item. If set to true, access to the * subscription or in-app item will be terminated immediately. If the item is * a recurring subscription, all future payments will also be terminated. * Consumed in-app items need to be handled by developer's app. (optional). */ revoke?: boolean; } /** * Details of a recurring external transaction product which doesn't belong to * any other more specific category. */ export interface OtherRecurringProduct { } /** * Pricing information for any new locations Play may launch in. */ export interface OtherRegionsBasePlanConfig { /** * Required. Price in EUR to use for any new locations Play may launch in. */ eurPrice?: Money; /** * 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?: boolean; /** * Required. Price in USD to use for any new locations Play may launch in. */ usdPrice?: Money; } function serializeOtherRegionsBasePlanConfig(data: any): OtherRegionsBasePlanConfig { return { ...data, eurPrice: data["eurPrice"] !== undefined ? serializeMoney(data["eurPrice"]) : undefined, usdPrice: data["usdPrice"] !== undefined ? serializeMoney(data["usdPrice"]) : undefined, }; } function deserializeOtherRegionsBasePlanConfig(data: any): OtherRegionsBasePlanConfig { return { ...data, eurPrice: data["eurPrice"] !== undefined ? deserializeMoney(data["eurPrice"]) : undefined, usdPrice: data["usdPrice"] !== undefined ? deserializeMoney(data["usdPrice"]) : undefined, }; } /** * Configuration for any new locations Play may launch in specified on a * subscription offer. */ export interface OtherRegionsSubscriptionOfferConfig { /** * Whether the subscription offer in any new locations Play may launch in the * future. If not specified, this will default to false. */ otherRegionsNewSubscriberAvailability?: boolean; } /** * Configuration for any new locations Play may launch in for a single offer * phase. */ export interface OtherRegionsSubscriptionOfferPhaseConfig { /** * 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; /** * Set to specify this offer is free to obtain. */ free?: OtherRegionsSubscriptionOfferPhaseFreePriceOverride; /** * 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; /** * 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?: number; } function serializeOtherRegionsSubscriptionOfferPhaseConfig(data: any): OtherRegionsSubscriptionOfferPhaseConfig { return { ...data, absoluteDiscounts: data["absoluteDiscounts"] !== undefined ? serializeOtherRegionsSubscriptionOfferPhasePrices(data["absoluteDiscounts"]) : undefined, otherRegionsPrices: data["otherRegionsPrices"] !== undefined ? serializeOtherRegionsSubscriptionOfferPhasePrices(data["otherRegionsPrices"]) : undefined, }; } function deserializeOtherRegionsSubscriptionOfferPhaseConfig(data: any): OtherRegionsSubscriptionOfferPhaseConfig { return { ...data, absoluteDiscounts: data["absoluteDiscounts"] !== undefined ? deserializeOtherRegionsSubscriptionOfferPhasePrices(data["absoluteDiscounts"]) : undefined, otherRegionsPrices: data["otherRegionsPrices"] !== undefined ? deserializeOtherRegionsSubscriptionOfferPhasePrices(data["otherRegionsPrices"]) : undefined, }; } /** * Represents the free price override configuration for any new locations Play * may launch for a single offer phase. */ export interface OtherRegionsSubscriptionOfferPhaseFreePriceOverride { } /** * Pricing information for any new locations Play may launch in. */ export interface OtherRegionsSubscriptionOfferPhasePrices { /** * Required. Price in EUR to use for any new locations Play may launch in. */ eurPrice?: Money; /** * Required. Price in USD to use for any new locations Play may launch in. */ usdPrice?: Money; } function serializeOtherRegionsSubscriptionOfferPhasePrices(data: any): OtherRegionsSubscriptionOfferPhasePrices { return { ...data, eurPrice: data["eurPrice"] !== undefined ? serializeMoney(data["eurPrice"]) : undefined, usdPrice: data["usdPrice"] !== undefined ? serializeMoney(data["usdPrice"]) : undefined, }; } function deserializeOtherRegionsSubscriptionOfferPhasePrices(data: any): OtherRegionsSubscriptionOfferPhasePrices { return { ...data, eurPrice: data["eurPrice"] !== undefined ? deserializeMoney(data["eurPrice"]) : undefined, usdPrice: data["usdPrice"] !== undefined ? deserializeMoney(data["usdPrice"]) : undefined, }; } /** * 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. */ export interface PageInfo { /** * Maximum number of results returned in one page. ! The number of results * included in the API response. */ resultPerPage?: number; /** * Index of the first result returned in the current page. */ startIndex?: number; /** * Total number of results available on the backend ! The total number of * results in the result set. */ totalResults?: number; } /** * A partial refund of a transaction. */ export interface PartialRefund { /** * Required. A unique id distinguishing this partial refund. If the refund is * successful, subsequent refunds with the same id will fail. Must be unique * across refunds for one individual transaction. */ refundId?: string; /** * Required. The pre-tax amount of the partial refund. Should be less than * the remaining pre-tax amount of the transaction. */ refundPreTaxAmount?: Price; } /** * Information specific to a subscription in paused state. */ export interface PausedStateContext { /** * Time at which the subscription will be automatically resumed. */ autoResumeTime?: Date; } function serializePausedStateContext(data: any): PausedStateContext { return { ...data, autoResumeTime: data["autoResumeTime"] !== undefined ? data["autoResumeTime"].toISOString() : undefined, }; } function deserializePausedStateContext(data: any): PausedStateContext { return { ...data, autoResumeTime: data["autoResumeTime"] !== undefined ? new Date(data["autoResumeTime"]) : undefined, }; } /** * This is an indicator of whether there is a pending cancellation on the * virtual installment plan. The cancellation will happen only after the user * finished all committed payments. */ export interface PendingCancellation { } /** * Represents a base plan that does not automatically renew at the end of the * base plan, and must be manually renewed by the user. */ export interface PrepaidBasePlanType { /** * Required. Immutable. Subscription period, specified in ISO 8601 format. * For a list of acceptable billing periods, refer to the help center. The * duration is immutable after the base plan is created. */ billingPeriodDuration?: string; /** * Whether users should be able to extend this prepaid base plan in Google * Play surfaces. Defaults to TIME_EXTENSION_ACTIVE if not specified. */ timeExtension?: | "TIME_EXTENSION_UNSPECIFIED" | "TIME_EXTENSION_ACTIVE" | "TIME_EXTENSION_INACTIVE"; } /** * Information related to a prepaid plan. */ export interface PrepaidPlan { /** * If present, this is the time after which top up purchases are allowed for * the prepaid plan. Will not be present for expired prepaid plans. */ allowExtendAfterTime?: Date; } function serializePrepaidPlan(data: any): PrepaidPlan { return { ...data, allowExtendAfterTime: data["allowExtendAfterTime"] !== undefined ? data["allowExtendAfterTime"].toISOString() : undefined, }; } function deserializePrepaidPlan(data: any): PrepaidPlan { return { ...data, allowExtendAfterTime: data["allowExtendAfterTime"] !== undefined ? new Date(data["allowExtendAfterTime"]) : undefined, }; } /** * Definition of a price, i.e. currency and units. */ export interface Price { /** * 3 letter Currency code, as defined by ISO 4217. See * java/com/google/common/money/CurrencyCode.java */ currency?: string; /** * Price in 1/million of the currency base unit, represented as a string. */ priceMicros?: string; } /** * A ProductPurchase resource indicates the status of a user's inapp product * purchase. */ export interface ProductPurchase { /** * The acknowledgement state of the inapp product. Possible values are: 0. * Yet to be acknowledged 1. Acknowledged */ acknowledgementState?: number; /** * The consumption state of the inapp product. Possible values are: 0. Yet to * be consumed 1. Consumed */ consumptionState?: number; /** * A developer-specified string that contains supplemental information about * an order. */ developerPayload?: string; /** * This kind represents an inappPurchase object in the androidpublisher * service. */ kind?: string; /** * 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; /** * 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; /** * The order id associated with the purchase of the inapp product. */ orderId?: string; /** * The inapp product SKU. May not be present. */ productId?: string; /** * The purchase state of the order. Possible values are: 0. Purchased 1. * Canceled 2. Pending */ purchaseState?: number; /** * The time the product was purchased, in milliseconds since the epoch (Jan * 1, 1970). */ purchaseTimeMillis?: bigint; /** * The purchase token generated to identify this purchase. May not be * present. */ purchaseToken?: string; /** * 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). Does not include Play Points * purchases. 2. Rewarded (i.e. from watching a video ad instead of paying) */ purchaseType?: number; /** * The quantity associated with the purchase of the inapp product. If not * present, the quantity is 1. */ quantity?: number; /** * The quantity eligible for refund, i.e. quantity that hasn't been refunded. * The value reflects quantity-based partial refunds and full refunds. */ refundableQuantity?: number; /** * ISO 3166-1 alpha-2 billing region code of the user at the time the product * was granted. */ regionCode?: string; } function serializeProductPurchase(data: any): ProductPurchase { return { ...data, purchaseTimeMillis: data["purchaseTimeMillis"] !== undefined ? String(data["purchaseTimeMillis"]) : undefined, }; } function deserializeProductPurchase(data: any): ProductPurchase { return { ...data, purchaseTimeMillis: data["purchaseTimeMillis"] !== undefined ? BigInt(data["purchaseTimeMillis"]) : undefined, }; } /** * Request for the product.purchases.acknowledge API. */ export interface ProductPurchasesAcknowledgeRequest { /** * Payload to attach to the purchase. */ developerPayload?: string; } /** * Additional options for Androidpublisher#purchasesVoidedpurchasesList. */ export interface PurchasesVoidedpurchasesListOptions { /** * The time, in milliseconds since the Epoch, of the newest voided purchase * that you want to see in the response. The value of this parameter cannot be * greater than the current time and is ignored if a pagination token is set. * Default value is current time. Note: This filter is applied on the time at * which the record is seen as voided by our systems and not the actual voided * time returned in the response. */ endTime?: bigint; /** * Optional. Whether to include voided purchases of quantity-based partial * refunds, which are applicable only to multi-quantity purchases. If true, * additional voided purchases may be returned with voidedQuantity that * indicates the refund quantity of a quantity-based partial refund. The * default value is false. */ includeQuantityBasedPartialRefund?: boolean; /** * Defines how many results the list operation should return. The default * number depends on the resource collection. */ maxResults?: number; /** * Defines the index of the first element to return. This can only be used if * indexed paging is enabled. */ startIndex?: number; /** * The time, in milliseconds since the Epoch, of the oldest voided purchase * that you want to see in the response. The value of this parameter cannot be * older than 30 days and is ignored if a pagination token is set. Default * value is current time minus 30 days. Note: This filter is applied on the * time at which the record is seen as voided by our systems and not the * actual voided time returned in the response. */ startTime?: bigint; /** * Defines the token of the page to return, usually taken from * TokenPagination. This can only be used if token paging is enabled. */ token?: string; /** * The type of voided purchases that you want to see in the response. * Possible values are: 0. Only voided in-app product purchases will be * returned in the response. This is the default value. 1. Both voided in-app * purchases and voided subscription purchases will be returned in the * response. Note: Before requesting to receive voided subscription purchases, * you must switch to use orderId in the response which uniquely identifies * one-time purchases and subscriptions. Otherwise, you will receive multiple * subscription orders with the same PurchaseToken, because subscription * renewal orders share the same PurchaseToken. */ type?: number; } function serializePurchasesVoidedpurchasesListOptions(data: any): PurchasesVoidedpurchasesListOptions { return { ...data, endTime: data["endTime"] !== undefined ? String(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? String(data["startTime"]) : undefined, }; } function deserializePurchasesVoidedpurchasesListOptions(data: any): PurchasesVoidedpurchasesListOptions { return { ...data, endTime: data["endTime"] !== undefined ? BigInt(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? BigInt(data["startTime"]) : undefined, }; } /** * Represents a transaction that is part of a recurring series of payments. * This can be a subscription or a one-time product with multiple payments (such * as preorder). */ export interface RecurringExternalTransaction { /** * Details of an external subscription. */ externalSubscription?: ExternalSubscription; /** * Input only. Provided during the call to Create. Retrieved from the client * when the alternative billing flow is launched. Required only for the * initial purchase. */ externalTransactionToken?: string; /** * The external transaction id of the first transaction of this recurring * series of transactions. For example, for a subscription this would be the * transaction id of the first payment. Required when creating recurring * external transactions. */ initialExternalTransactionId?: string; /** * Input only. Provided during the call to Create. Must only be used when * migrating a subscription from manual monthly reporting to automated * reporting. */ migratedTransactionProgram?: | "EXTERNAL_TRANSACTION_PROGRAM_UNSPECIFIED" | "USER_CHOICE_BILLING" | "ALTERNATIVE_BILLING_ONLY"; /** * Details of a recurring external transaction product which doesn't belong * to any other specific category. */ otherRecurringProduct?: OtherRecurringProduct; } /** * A request to refund an existing external transaction. */ export interface RefundExternalTransactionRequest { /** * A full-amount refund. */ fullRefund?: FullRefund; /** * A partial refund. */ partialRefund?: PartialRefund; /** * Required. The time that the transaction was refunded. */ refundTime?: Date; } function serializeRefundExternalTransactionRequest(data: any): RefundExternalTransactionRequest { return { ...data, refundTime: data["refundTime"] !== undefined ? data["refundTime"].toISOString() : undefined, }; } function deserializeRefundExternalTransactionRequest(data: any): RefundExternalTransactionRequest { return { ...data, refundTime: data["refundTime"] !== undefined ? new Date(data["refundTime"]) : undefined, }; } /** * Configuration for a base plan specific to a region. */ export interface RegionalBasePlanConfig { /** * 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?: boolean; /** * 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; /** * Required. Region code this configuration applies to, as defined by ISO * 3166-2, e.g. "US". */ regionCode?: string; } function serializeRegionalBasePlanConfig(data: any): RegionalBasePlanConfig { return { ...data, price: data["price"] !== undefined ? serializeMoney(data["price"]) : undefined, }; } function deserializeRegionalBasePlanConfig(data: any): RegionalBasePlanConfig { return { ...data, price: data["price"] !== undefined ? deserializeMoney(data["price"]) : undefined, }; } /** * Configuration for migration of a legacy price cohort. */ export interface RegionalPriceMigrationConfig { /** * Required. Subscribers in all legacy price cohorts before this time will be * migrated to the current price. Subscribers in any newer price cohorts are * unaffected. Affected subscribers will receive one or more notifications * from Google Play about the price change. Price decreases occur at the * subscriber's next billing date. Price increases occur at the subscriber's * next billing date following a notification period that varies by region and * price increase type. */ oldestAllowedPriceVersionTime?: Date; /** * Optional. The requested type of price increase */ priceIncreaseType?: | "PRICE_INCREASE_TYPE_UNSPECIFIED" | "PRICE_INCREASE_TYPE_OPT_IN" | "PRICE_INCREASE_TYPE_OPT_OUT"; /** * Required. Region code this configuration applies to, as defined by ISO * 3166-2, e.g. "US". */ regionCode?: string; } function serializeRegionalPriceMigrationConfig(data: any): RegionalPriceMigrationConfig { return { ...data, oldestAllowedPriceVersionTime: data["oldestAllowedPriceVersionTime"] !== undefined ? data["oldestAllowedPriceVersionTime"].toISOString() : undefined, }; } function deserializeRegionalPriceMigrationConfig(data: any): RegionalPriceMigrationConfig { return { ...data, oldestAllowedPriceVersionTime: data["oldestAllowedPriceVersionTime"] !== undefined ? new Date(data["oldestAllowedPriceVersionTime"]) : undefined, }; } /** * Configuration for a subscription offer in a single region. */ export interface RegionalSubscriptionOfferConfig { /** * 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?: boolean; /** * Required. Immutable. Region code this configuration applies to, as defined * by ISO 3166-2, e.g. "US". */ regionCode?: string; } /** * Configuration for a single phase of a subscription offer in a single region. */ export interface RegionalSubscriptionOfferPhaseConfig { /** * 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; /** * Set to specify this offer is free to obtain. */ free?: RegionalSubscriptionOfferPhaseFreePriceOverride; /** * 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; /** * Required. Immutable. The region to which this config applies. */ regionCode?: string; /** * 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?: number; } function serializeRegionalSubscriptionOfferPhaseConfig(data: any): RegionalSubscriptionOfferPhaseConfig { return { ...data, absoluteDiscount: data["absoluteDiscount"] !== undefined ? serializeMoney(data["absoluteDiscount"]) : undefined, price: data["price"] !== undefined ? serializeMoney(data["price"]) : undefined, }; } function deserializeRegionalSubscriptionOfferPhaseConfig(data: any): RegionalSubscriptionOfferPhaseConfig { return { ...data, absoluteDiscount: data["absoluteDiscount"] !== undefined ? deserializeMoney(data["absoluteDiscount"]) : undefined, price: data["price"] !== undefined ? deserializeMoney(data["price"]) : undefined, }; } /** * Represents the free price override configuration for a single phase of a * subscription offer */ export interface RegionalSubscriptionOfferPhaseFreePriceOverride { } /** * Specified details about taxation in a given geographical region. */ export interface RegionalTaxRateInfo { /** * You must tell us if your app contains streaming products to correctly * charge US state and local sales tax. Field only supported in the United * States. */ eligibleForStreamingServiceTaxRate?: boolean; /** * To collect communications or amusement taxes in the United States, choose * the appropriate tax category. [Learn * more](https://support.google.com/googleplay/android-developer/answer/10463498#streaming_tax). */ streamingTaxType?: | "STREAMING_TAX_TYPE_UNSPECIFIED" | "STREAMING_TAX_TYPE_TELCO_VIDEO_RENTAL" | "STREAMING_TAX_TYPE_TELCO_VIDEO_SALES" | "STREAMING_TAX_TYPE_TELCO_VIDEO_MULTI_CHANNEL" | "STREAMING_TAX_TYPE_TELCO_AUDIO_RENTAL" | "STREAMING_TAX_TYPE_TELCO_AUDIO_SALES" | "STREAMING_TAX_TYPE_TELCO_AUDIO_MULTI_CHANNEL"; /** * 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). */ taxTier?: | "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"; } /** * Region targeting data for app recovery action targeting. */ export interface Regions { /** * Regions targeted by the recovery action. Region codes are ISO 3166 Alpha-2 * country codes. For example, US stands for United States of America. See * https://www.iso.org/iso-3166-country-codes.html for the complete list of * country codes. */ regionCode?: string[]; } /** * The version of the available regions being used for the specified resource. */ export interface RegionsVersion { /** * Required. A string representing the version of available regions being * used for the specified resource. Regional prices for the resource have to * be specified according to the information published in [this * article](https://support.google.com/googleplay/android-developer/answer/10532353). * Each time the supported locations substantially change, the version will be * incremented. Using this field will ensure that creating and updating the * resource with an older region's version and set of regional prices and * currencies will succeed even though a new version is available. The latest * version is 2022/02. */ version?: string; } /** * Object representation for Remote in-app update action type. */ export interface RemoteInAppUpdate { /** * Required. Set to true if Remote In-App Update action type is needed. */ isRemoteInAppUpdateRequested?: boolean; } /** * Data related to Remote In-App Update action such as recovered user count, * affected user count etc. */ export interface RemoteInAppUpdateData { /** * Data related to the recovery action at bundle level. */ remoteAppUpdateDataPerBundle?: RemoteInAppUpdateDataPerBundle[]; } function serializeRemoteInAppUpdateData(data: any): RemoteInAppUpdateData { return { ...data, remoteAppUpdateDataPerBundle: data["remoteAppUpdateDataPerBundle"] !== undefined ? data["remoteAppUpdateDataPerBundle"].map((item: any) => (serializeRemoteInAppUpdateDataPerBundle(item))) : undefined, }; } function deserializeRemoteInAppUpdateData(data: any): RemoteInAppUpdateData { return { ...data, remoteAppUpdateDataPerBundle: data["remoteAppUpdateDataPerBundle"] !== undefined ? data["remoteAppUpdateDataPerBundle"].map((item: any) => (deserializeRemoteInAppUpdateDataPerBundle(item))) : undefined, }; } /** * Data related to the recovery action at bundle level. */ export interface RemoteInAppUpdateDataPerBundle { /** * Total number of devices which have been rescued. */ recoveredDeviceCount?: bigint; /** * Total number of devices affected by this recovery action associated with * bundle of the app. */ totalDeviceCount?: bigint; /** * Version Code corresponding to the target bundle. */ versionCode?: bigint; } function serializeRemoteInAppUpdateDataPerBundle(data: any): RemoteInAppUpdateDataPerBundle { return { ...data, recoveredDeviceCount: data["recoveredDeviceCount"] !== undefined ? String(data["recoveredDeviceCount"]) : undefined, totalDeviceCount: data["totalDeviceCount"] !== undefined ? String(data["totalDeviceCount"]) : undefined, versionCode: data["versionCode"] !== undefined ? String(data["versionCode"]) : undefined, }; } function deserializeRemoteInAppUpdateDataPerBundle(data: any): RemoteInAppUpdateDataPerBundle { return { ...data, recoveredDeviceCount: data["recoveredDeviceCount"] !== undefined ? BigInt(data["recoveredDeviceCount"]) : undefined, totalDeviceCount: data["totalDeviceCount"] !== undefined ? BigInt(data["totalDeviceCount"]) : undefined, versionCode: data["versionCode"] !== undefined ? BigInt(data["versionCode"]) : undefined, }; } /** * Information specific to cancellations caused by subscription replacement. */ export interface ReplacementCancellation { } /** * Countries where the purchase of this product is restricted to payment * methods registered in the same country. If empty, no payment location * restrictions are imposed. */ export interface RestrictedPaymentCountries { /** * Required. Region codes to impose payment restrictions on, as defined by * ISO 3166-2, e.g. "US". */ regionCodes?: string[]; } /** * An Android app review. */ export interface Review { /** * The name of the user who wrote the review. */ authorName?: string; /** * A repeated field containing comments for the review. */ comments?: Comment[]; /** * Unique identifier for this review. */ reviewId?: string; } function serializeReview(data: any): Review { return { ...data, comments: data["comments"] !== undefined ? data["comments"].map((item: any) => (serializeComment(item))) : undefined, }; } function deserializeReview(data: any): Review { return { ...data, comments: data["comments"] !== undefined ? data["comments"].map((item: any) => (deserializeComment(item))) : undefined, }; } /** * The result of replying/updating a reply to review. */ export interface ReviewReplyResult { /** * The time at which the reply took effect. */ lastEdited?: Timestamp; /** * The reply text that was applied. */ replyText?: string; } function serializeReviewReplyResult(data: any): ReviewReplyResult { return { ...data, lastEdited: data["lastEdited"] !== undefined ? serializeTimestamp(data["lastEdited"]) : undefined, }; } function deserializeReviewReplyResult(data: any): ReviewReplyResult { return { ...data, lastEdited: data["lastEdited"] !== undefined ? deserializeTimestamp(data["lastEdited"]) : undefined, }; } /** * Additional options for Androidpublisher#reviewsGet. */ export interface ReviewsGetOptions { /** * Language localization code. */ translationLanguage?: string; } /** * Additional options for Androidpublisher#reviewsList. */ export interface ReviewsListOptions { /** * How many results the list operation should return. */ maxResults?: number; /** * The index of the first element to return. */ startIndex?: number; /** * Pagination token. If empty, list starts at the first review. */ token?: string; /** * Language localization code. */ translationLanguage?: string; } /** * Response listing reviews. */ export interface ReviewsListResponse { /** * Information about the current page. */ pageInfo?: PageInfo; /** * List of reviews. */ reviews?: Review[]; /** * Pagination token, to handle a number of products that is over one page. */ tokenPagination?: TokenPagination; } function serializeReviewsListResponse(data: any): ReviewsListResponse { return { ...data, reviews: data["reviews"] !== undefined ? data["reviews"].map((item: any) => (serializeReview(item))) : undefined, }; } function deserializeReviewsListResponse(data: any): ReviewsListResponse { return { ...data, reviews: data["reviews"] !== undefined ? data["reviews"].map((item: any) => (deserializeReview(item))) : undefined, }; } /** * Request to reply to review or update existing reply. */ export interface ReviewsReplyRequest { /** * The text to set as the reply. Replies of more than approximately 350 * characters will be rejected. HTML tags will be stripped. */ replyText?: string; } /** * Response on status of replying to a review. */ export interface ReviewsReplyResponse { /** * The result of replying/updating a reply to review. */ result?: ReviewReplyResult; } function serializeReviewsReplyResponse(data: any): ReviewsReplyResponse { return { ...data, result: data["result"] !== undefined ? serializeReviewReplyResult(data["result"]) : undefined, }; } function deserializeReviewsReplyResponse(data: any): ReviewsReplyResponse { return { ...data, result: data["result"] !== undefined ? deserializeReviewReplyResult(data["result"]) : undefined, }; } /** * Revocation context of the purchases.subscriptionsv2.revoke API. */ export interface RevocationContext { /** * Optional. Used when users should be refunded the full amount of the latest * order of the subscription. */ fullRefund?: RevocationContextFullRefund; /** * Optional. Used when users should be refunded a prorated amount they paid * for their subscription based on the amount of time remaining in a * subscription. */ proratedRefund?: RevocationContextProratedRefund; } /** * Used to determine if the refund type in the RevocationContext is a full * refund. */ export interface RevocationContextFullRefund { } /** * Used to determine if the refund type in the RevocationContext is a prorated * refund. */ export interface RevocationContextProratedRefund { } /** * Request for the purchases.subscriptionsv2.revoke API. */ export interface RevokeSubscriptionPurchaseRequest { /** * Required. Additional details around the subscription revocation. */ revocationContext?: RevocationContext; } /** * Response for the purchases.subscriptionsv2.revoke API. */ export interface RevokeSubscriptionPurchaseResponse { } /** * Request to update Safety Labels of an app. */ export interface SafetyLabelsUpdateRequest { /** * Required. Contents of the CSV file containing Data Safety responses. For * the format of this file, see the Help Center documentation at * https://support.google.com/googleplay/android-developer/answer/10787469?#zippy=%2Cunderstand-the-csv-format * To download an up to date template, follow the steps at * https://support.google.com/googleplay/android-developer/answer/10787469?#zippy=%2Cexport-to-a-csv-file */ safetyLabels?: string; } /** * Response for SafetyLabelsUpdate rpc. */ export interface SafetyLabelsUpdateResponse { } /** * Represents a screen density. */ export interface ScreenDensity { /** * Alias for a screen density. */ densityAlias?: | "DENSITY_UNSPECIFIED" | "NODPI" | "LDPI" | "MDPI" | "TVDPI" | "HDPI" | "XHDPI" | "XXHDPI" | "XXXHDPI"; /** * Value for density dpi. */ densityDpi?: number; } /** * Targeting based on screen density. */ export interface ScreenDensityTargeting { /** * Targeting of other sibling directories that were in the Bundle. For main * splits this is targeting of other main splits. */ alternatives?: ScreenDensity[]; /** * Value of a screen density. */ value?: ScreenDensity[]; } /** * Represents an sdk version. */ export interface SdkVersion { /** * Inclusive minimum value of an sdk version. */ min?: number; } /** * Targeting based on sdk version. */ export interface SdkVersionTargeting { /** * Targeting of other sibling directories that were in the Bundle. For main * splits this is targeting of other main splits. */ alternatives?: SdkVersion[]; /** * Value of an sdk version. */ value?: SdkVersion[]; } /** * The promotion applied on this item when purchased. */ export interface SignupPromotion { /** * A one-time code was applied. */ oneTimeCode?: OneTimeCode; /** * A vanity code was applied. */ vanityCode?: VanityCode; } /** * Holds data specific to Split APKs. */ export interface SplitApkMetadata { /** * Indicates whether this APK is the main split of the module. */ isMasterSplit?: boolean; /** * Id of the split. */ splitId?: string; } /** * Variant is a group of APKs that covers a part of the device configuration * space. APKs from multiple variants are never combined on one device. */ export interface SplitApkVariant { /** * Set of APKs, one set per module. */ apkSet?: ApkSet[]; /** * Variant-level targeting. */ targeting?: VariantTargeting; /** * Number of the variant, starting at 0 (unless overridden). A device will * receive APKs from the first variant that matches the device configuration, * with higher variant numbers having priority over lower variant numbers. */ variantNumber?: number; } /** * Holds data specific to Standalone APKs. */ export interface StandaloneApkMetadata { /** * Names of the modules fused in this standalone APK. */ fusedModuleName?: string[]; } /** * Information associated with purchases made with 'Subscribe with Google'. */ export interface SubscribeWithGoogleInfo { /** * The email address of the user when the subscription was purchased. */ emailAddress?: string; /** * The family name of the user when the subscription was purchased. */ familyName?: string; /** * The given name of the user when the subscription was purchased. */ givenName?: string; /** * The Google profile id of the user when the subscription was purchased. */ profileId?: string; /** * The profile name of the user when the subscription was purchased. */ profileName?: string; } /** * A single subscription for an app. */ export interface Subscription { /** * Output only. Deprecated: subscription archiving is not supported. */ readonly archived?: boolean; /** * The set of base plans for this subscription. Represents the prices and * duration of the subscription if no other offers apply. */ basePlans?: BasePlan[]; /** * Required. List of localized listings for this subscription. Must contain * at least an entry for the default language of the parent app. */ listings?: SubscriptionListing[]; /** * Immutable. Package name of the parent app. */ packageName?: string; /** * 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; /** * Optional. Countries where the purchase of this subscription is restricted * to payment methods registered in the same country. If empty, no payment * location restrictions are imposed. */ restrictedPaymentCountries?: RestrictedPaymentCountries; /** * Details about taxes and legal compliance. */ taxAndComplianceSettings?: SubscriptionTaxAndComplianceSettings; } function serializeSubscription(data: any): Subscription { return { ...data, basePlans: data["basePlans"] !== undefined ? data["basePlans"].map((item: any) => (serializeBasePlan(item))) : undefined, }; } function deserializeSubscription(data: any): Subscription { return { ...data, basePlans: data["basePlans"] !== undefined ? data["basePlans"].map((item: any) => (deserializeBasePlan(item))) : undefined, }; } /** * Information provided by the user when they complete the subscription * cancellation flow (cancellation reason survey). */ export interface SubscriptionCancelSurveyResult { /** * 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?: number; /** * The customized input cancel reason from the user. Only present when * cancelReason is 0. */ userInputCancelReason?: string; } /** * A SubscriptionDeferralInfo contains the data needed to defer a subscription * purchase to a future expiry time. */ export interface SubscriptionDeferralInfo { /** * 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?: bigint; /** * 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?: bigint; } function serializeSubscriptionDeferralInfo(data: any): SubscriptionDeferralInfo { return { ...data, desiredExpiryTimeMillis: data["desiredExpiryTimeMillis"] !== undefined ? String(data["desiredExpiryTimeMillis"]) : undefined, expectedExpiryTimeMillis: data["expectedExpiryTimeMillis"] !== undefined ? String(data["expectedExpiryTimeMillis"]) : undefined, }; } function deserializeSubscriptionDeferralInfo(data: any): SubscriptionDeferralInfo { return { ...data, desiredExpiryTimeMillis: data["desiredExpiryTimeMillis"] !== undefined ? BigInt(data["desiredExpiryTimeMillis"]) : undefined, expectedExpiryTimeMillis: data["expectedExpiryTimeMillis"] !== undefined ? BigInt(data["expectedExpiryTimeMillis"]) : undefined, }; } /** * Price change related information of a subscription item. */ export interface SubscriptionItemPriceChangeDetails { /** * The renewal time at which the price change will become effective for the * user. This is subject to change(to a future time) due to cases where the * renewal time shifts like pause. This field is only populated if the price * change has not taken effect. */ expectedNewPriceChargeTime?: Date; /** * New recurring price for the subscription item. */ newPrice?: Money; /** * Price change mode specifies how the subscription item price is changing. */ priceChangeMode?: | "PRICE_CHANGE_MODE_UNSPECIFIED" | "PRICE_DECREASE" | "PRICE_INCREASE" | "OPT_OUT_PRICE_INCREASE"; /** * State the price change is currently in. */ priceChangeState?: | "PRICE_CHANGE_STATE_UNSPECIFIED" | "OUTSTANDING" | "CONFIRMED" | "APPLIED"; } function serializeSubscriptionItemPriceChangeDetails(data: any): SubscriptionItemPriceChangeDetails { return { ...data, expectedNewPriceChargeTime: data["expectedNewPriceChargeTime"] !== undefined ? data["expectedNewPriceChargeTime"].toISOString() : undefined, newPrice: data["newPrice"] !== undefined ? serializeMoney(data["newPrice"]) : undefined, }; } function deserializeSubscriptionItemPriceChangeDetails(data: any): SubscriptionItemPriceChangeDetails { return { ...data, expectedNewPriceChargeTime: data["expectedNewPriceChargeTime"] !== undefined ? new Date(data["expectedNewPriceChargeTime"]) : undefined, newPrice: data["newPrice"] !== undefined ? deserializeMoney(data["newPrice"]) : undefined, }; } /** * The consumer-visible metadata of a subscription. */ export interface SubscriptionListing { /** * 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[]; /** * The description of this subscription in the language of this listing. * Maximum length - 80 characters. Plain text. */ description?: string; /** * Required. The language of this listing, as defined by BCP-47, e.g. * "en-US". */ languageCode?: string; /** * Required. The title of this subscription in the language of this listing. * Plain text. */ title?: string; } /** * A single, temporary offer */ export interface SubscriptionOffer { /** * Required. Immutable. The ID of the base plan to which this offer is an * extension. */ basePlanId?: string; /** * Required. Immutable. Unique ID of this subscription offer. Must be unique * within the base plan. */ offerId?: string; /** * List of up to 20 custom tags specified for this offer, and returned to the * app through the billing library. */ offerTags?: OfferTag[]; /** * The configuration for any new locations Play may launch in the future. */ otherRegionsConfig?: OtherRegionsSubscriptionOfferConfig; /** * Required. Immutable. The package name of the app the parent subscription * belongs to. */ packageName?: string; /** * Required. The phases of this subscription offer. Must contain at least one * and at most two entries. Users will always receive all these phases in the * specified order. */ phases?: SubscriptionOfferPhase[]; /** * Required. Immutable. The ID of the parent subscription this offer belongs * to. */ productId?: string; /** * Required. The region-specific configuration of this offer. Must contain at * least one entry. */ regionalConfigs?: RegionalSubscriptionOfferConfig[]; /** * 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. */ readonly state?: | "STATE_UNSPECIFIED" | "DRAFT" | "ACTIVE" | "INACTIVE"; /** * 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; } function serializeSubscriptionOffer(data: any): SubscriptionOffer { return { ...data, phases: data["phases"] !== undefined ? data["phases"].map((item: any) => (serializeSubscriptionOfferPhase(item))) : undefined, }; } function deserializeSubscriptionOffer(data: any): SubscriptionOffer { return { ...data, phases: data["phases"] !== undefined ? data["phases"].map((item: any) => (deserializeSubscriptionOfferPhase(item))) : undefined, }; } /** * A single phase of a subscription offer. */ export interface SubscriptionOfferPhase { /** * Required. The duration of a single recurrence of this phase. Specified in * ISO 8601 format. */ duration?: string; /** * Pricing information for any new locations Play may launch in. */ otherRegionsConfig?: OtherRegionsSubscriptionOfferPhaseConfig; /** * 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?: number; /** * 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[]; } function serializeSubscriptionOfferPhase(data: any): SubscriptionOfferPhase { return { ...data, otherRegionsConfig: data["otherRegionsConfig"] !== undefined ? serializeOtherRegionsSubscriptionOfferPhaseConfig(data["otherRegionsConfig"]) : undefined, regionalConfigs: data["regionalConfigs"] !== undefined ? data["regionalConfigs"].map((item: any) => (serializeRegionalSubscriptionOfferPhaseConfig(item))) : undefined, }; } function deserializeSubscriptionOfferPhase(data: any): SubscriptionOfferPhase { return { ...data, otherRegionsConfig: data["otherRegionsConfig"] !== undefined ? deserializeOtherRegionsSubscriptionOfferPhaseConfig(data["otherRegionsConfig"]) : undefined, regionalConfigs: data["regionalConfigs"] !== undefined ? data["regionalConfigs"].map((item: any) => (deserializeRegionalSubscriptionOfferPhaseConfig(item))) : undefined, }; } /** * Defines the rule a user needs to satisfy to receive this offer. */ export interface SubscriptionOfferTargeting { /** * Offer targeting rule for new user acquisition. */ acquisitionRule?: AcquisitionTargetingRule; /** * Offer targeting rule for upgrading users' existing plans. */ upgradeRule?: UpgradeTargetingRule; } /** * 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. */ export interface SubscriptionPriceChange { /** * The new price the subscription will renew with if the price change is * accepted by the user. */ newPrice?: Price; /** * 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?: number; } /** * A SubscriptionPurchase resource indicates the status of a user's * subscription purchase. */ export interface SubscriptionPurchase { /** * The acknowledgement state of the subscription product. Possible values * are: 0. Yet to be acknowledged 1. Acknowledged */ acknowledgementState?: number; /** * Whether the subscription will automatically be renewed when it reaches its * current expiry time. */ autoRenewing?: boolean; /** * 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?: bigint; /** * 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?: number; /** * Information provided by the user when they complete the subscription * cancellation flow (cancellation reason survey). */ cancelSurveyResult?: SubscriptionCancelSurveyResult; /** * ISO 3166-1 alpha-2 billing country/region code of the user at the time the * subscription was granted. */ countryCode?: string; /** * A developer-specified string that contains supplemental information about * an order. */ developerPayload?: string; /** * The email address of the user when the subscription was purchased. Only * present for purchases made with 'Subscribe with Google'. */ emailAddress?: string; /** * Time at which the subscription will expire, in milliseconds since the * Epoch. */ expiryTimeMillis?: bigint; /** * User account identifier in the third-party service. Only present if * account linking happened as part of the subscription purchase flow. */ externalAccountId?: string; /** * The family name of the user when the subscription was purchased. Only * present for purchases made with 'Subscribe with Google'. */ familyName?: string; /** * The given name of the user when the subscription was purchased. Only * present for purchases made with 'Subscribe with Google'. */ givenName?: string; /** * 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; /** * This kind represents a subscriptionPurchase object in the androidpublisher * service. */ kind?: string; /** * 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; /** * 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; /** * 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; /** * 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; /** * 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?: number; /** * 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?: bigint; /** * 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; /** * 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; /** * The Google profile id of the user when the subscription was purchased. * Only present for purchases made with 'Subscribe with Google'. */ profileId?: string; /** * The profile name of the user when the subscription was purchased. Only * present for purchases made with 'Subscribe with Google'. */ profileName?: string; /** * 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; /** * 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?: number; /** * 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?: number; /** * Time at which the subscription was granted, in milliseconds since the * Epoch. */ startTimeMillis?: bigint; /** * The time at which the subscription was canceled by the user, in * milliseconds since the epoch. Only present if cancelReason is 0. */ userCancellationTimeMillis?: bigint; } function serializeSubscriptionPurchase(data: any): SubscriptionPurchase { return { ...data, autoResumeTimeMillis: data["autoResumeTimeMillis"] !== undefined ? String(data["autoResumeTimeMillis"]) : undefined, expiryTimeMillis: data["expiryTimeMillis"] !== undefined ? String(data["expiryTimeMillis"]) : undefined, introductoryPriceInfo: data["introductoryPriceInfo"] !== undefined ? serializeIntroductoryPriceInfo(data["introductoryPriceInfo"]) : undefined, priceAmountMicros: data["priceAmountMicros"] !== undefined ? String(data["priceAmountMicros"]) : undefined, startTimeMillis: data["startTimeMillis"] !== undefined ? String(data["startTimeMillis"]) : undefined, userCancellationTimeMillis: data["userCancellationTimeMillis"] !== undefined ? String(data["userCancellationTimeMillis"]) : undefined, }; } function deserializeSubscriptionPurchase(data: any): SubscriptionPurchase { return { ...data, autoResumeTimeMillis: data["autoResumeTimeMillis"] !== undefined ? BigInt(data["autoResumeTimeMillis"]) : undefined, expiryTimeMillis: data["expiryTimeMillis"] !== undefined ? BigInt(data["expiryTimeMillis"]) : undefined, introductoryPriceInfo: data["introductoryPriceInfo"] !== undefined ? deserializeIntroductoryPriceInfo(data["introductoryPriceInfo"]) : undefined, priceAmountMicros: data["priceAmountMicros"] !== undefined ? BigInt(data["priceAmountMicros"]) : undefined, startTimeMillis: data["startTimeMillis"] !== undefined ? BigInt(data["startTimeMillis"]) : undefined, userCancellationTimeMillis: data["userCancellationTimeMillis"] !== undefined ? BigInt(data["userCancellationTimeMillis"]) : undefined, }; } /** * Item-level info for a subscription purchase. */ export interface SubscriptionPurchaseLineItem { /** * The item is auto renewing. */ autoRenewingPlan?: AutoRenewingPlan; /** * Information for deferred item replacement. */ deferredItemReplacement?: DeferredItemReplacement; /** * Time at which the subscription expired or will expire unless the access is * extended (ex. renews). */ expiryTime?: Date; /** * The offer details for this item. */ offerDetails?: OfferDetails; /** * The item is prepaid. */ prepaidPlan?: PrepaidPlan; /** * The purchased product ID (for example, 'monthly001'). */ productId?: string; /** * Promotion details about this item. Only set if a promotion was applied * during signup. */ signupPromotion?: SignupPromotion; } function serializeSubscriptionPurchaseLineItem(data: any): SubscriptionPurchaseLineItem { return { ...data, autoRenewingPlan: data["autoRenewingPlan"] !== undefined ? serializeAutoRenewingPlan(data["autoRenewingPlan"]) : undefined, expiryTime: data["expiryTime"] !== undefined ? data["expiryTime"].toISOString() : undefined, prepaidPlan: data["prepaidPlan"] !== undefined ? serializePrepaidPlan(data["prepaidPlan"]) : undefined, }; } function deserializeSubscriptionPurchaseLineItem(data: any): SubscriptionPurchaseLineItem { return { ...data, autoRenewingPlan: data["autoRenewingPlan"] !== undefined ? deserializeAutoRenewingPlan(data["autoRenewingPlan"]) : undefined, expiryTime: data["expiryTime"] !== undefined ? new Date(data["expiryTime"]) : undefined, prepaidPlan: data["prepaidPlan"] !== undefined ? deserializePrepaidPlan(data["prepaidPlan"]) : undefined, }; } /** * Request for the purchases.subscriptions.acknowledge API. */ export interface SubscriptionPurchasesAcknowledgeRequest { /** * Payload to attach to the purchase. */ developerPayload?: string; } /** * Request for the purchases.subscriptions.defer API. */ export interface SubscriptionPurchasesDeferRequest { /** * The information about the new desired expiry time for the subscription. */ deferralInfo?: SubscriptionDeferralInfo; } function serializeSubscriptionPurchasesDeferRequest(data: any): SubscriptionPurchasesDeferRequest { return { ...data, deferralInfo: data["deferralInfo"] !== undefined ? serializeSubscriptionDeferralInfo(data["deferralInfo"]) : undefined, }; } function deserializeSubscriptionPurchasesDeferRequest(data: any): SubscriptionPurchasesDeferRequest { return { ...data, deferralInfo: data["deferralInfo"] !== undefined ? deserializeSubscriptionDeferralInfo(data["deferralInfo"]) : undefined, }; } /** * Response for the purchases.subscriptions.defer API. */ export interface SubscriptionPurchasesDeferResponse { /** * The new expiry time for the subscription in milliseconds since the Epoch. */ newExpiryTimeMillis?: bigint; } function serializeSubscriptionPurchasesDeferResponse(data: any): SubscriptionPurchasesDeferResponse { return { ...data, newExpiryTimeMillis: data["newExpiryTimeMillis"] !== undefined ? String(data["newExpiryTimeMillis"]) : undefined, }; } function deserializeSubscriptionPurchasesDeferResponse(data: any): SubscriptionPurchasesDeferResponse { return { ...data, newExpiryTimeMillis: data["newExpiryTimeMillis"] !== undefined ? BigInt(data["newExpiryTimeMillis"]) : undefined, }; } /** * Indicates the status of a user's subscription purchase. */ export interface SubscriptionPurchaseV2 { /** * The acknowledgement state of the subscription. */ acknowledgementState?: | "ACKNOWLEDGEMENT_STATE_UNSPECIFIED" | "ACKNOWLEDGEMENT_STATE_PENDING" | "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED"; /** * Additional context around canceled subscriptions. Only present if the * subscription currently has subscription_state SUBSCRIPTION_STATE_CANCELED * or SUBSCRIPTION_STATE_EXPIRED. */ canceledStateContext?: CanceledStateContext; /** * User account identifier in the third-party service. */ externalAccountIdentifiers?: ExternalAccountIdentifiers; /** * This kind represents a SubscriptionPurchaseV2 object in the * androidpublisher service. */ kind?: string; /** * 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; /** * 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[]; /** * 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; /** * Additional context around paused subscriptions. Only present if the * subscription currently has subscription_state SUBSCRIPTION_STATE_PAUSED. */ pausedStateContext?: PausedStateContext; /** * ISO 3166-1 alpha-2 billing country/region code of the user at the time the * subscription was granted. */ regionCode?: string; /** * Time at which the subscription was granted. Not set for pending * subscriptions (subscription was created but awaiting payment during * signup). */ startTime?: Date; /** * User profile associated with purchases made with 'Subscribe with Google'. */ subscribeWithGoogleInfo?: SubscribeWithGoogleInfo; /** * The current state of the subscription. */ subscriptionState?: | "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" | "SUBSCRIPTION_STATE_PENDING_PURCHASE_CANCELED"; /** * Only present if this subscription purchase is a test purchase. */ testPurchase?: TestPurchase; } function serializeSubscriptionPurchaseV2(data: any): SubscriptionPurchaseV2 { return { ...data, canceledStateContext: data["canceledStateContext"] !== undefined ? serializeCanceledStateContext(data["canceledStateContext"]) : undefined, lineItems: data["lineItems"] !== undefined ? data["lineItems"].map((item: any) => (serializeSubscriptionPurchaseLineItem(item))) : undefined, pausedStateContext: data["pausedStateContext"] !== undefined ? serializePausedStateContext(data["pausedStateContext"]) : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeSubscriptionPurchaseV2(data: any): SubscriptionPurchaseV2 { return { ...data, canceledStateContext: data["canceledStateContext"] !== undefined ? deserializeCanceledStateContext(data["canceledStateContext"]) : undefined, lineItems: data["lineItems"] !== undefined ? data["lineItems"].map((item: any) => (deserializeSubscriptionPurchaseLineItem(item))) : undefined, pausedStateContext: data["pausedStateContext"] !== undefined ? deserializePausedStateContext(data["pausedStateContext"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Details about taxation, Google Play policy and legal compliance for * subscription products. */ export interface SubscriptionTaxAndComplianceSettings { /** * 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. */ eeaWithdrawalRightType?: | "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" | "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" | "WITHDRAWAL_RIGHT_SERVICE"; /** * Whether this subscription is declared as a product representing a * tokenized digital asset. */ isTokenizedDigitalAsset?: boolean; /** * A mapping from region code to tax rate details. The keys are region codes * as defined by Unicode's "CLDR". */ taxRateInfoByRegionCode?: { [key: string]: RegionalTaxRateInfo }; } /** * Options for system APKs. */ export interface SystemApkOptions { /** * Whether to use the rotated key for signing the system APK. */ rotated?: boolean; /** * Whether system APK was generated with uncompressed dex files. */ uncompressedDexFiles?: boolean; /** * Whether system APK was generated with uncompressed native libraries. */ uncompressedNativeLibraries?: boolean; } /** * Response to list previously created system APK variants. */ export interface SystemApksListResponse { /** * All system APK variants created. */ variants?: Variant[]; } /** * Representation of a system feature. */ export interface SystemFeature { /** * The name of the feature. */ name?: string; } /** * Information specific to cancellations initiated by Google system. */ export interface SystemInitiatedCancellation { } /** * Representation of a System-on-Chip (SoC) of an Android device. Can be used * to target S+ devices. */ export interface SystemOnChip { /** * Required. The designer of the SoC, eg. "Google" Value of build property * "ro.soc.manufacturer" * https://developer.android.com/reference/android/os/Build#SOC_MANUFACTURER * Required. */ manufacturer?: string; /** * Required. The model of the SoC, eg. "Tensor" Value of build property * "ro.soc.model" * https://developer.android.com/reference/android/os/Build#SOC_MODEL * Required. */ model?: string; } /** * Targeting details for a recovery action such as regions, android sdk levels, * app versions etc. */ export interface Targeting { /** * All users are targeted. */ allUsers?: AllUsers; /** * Targeting is based on android api levels of devices. */ androidSdks?: AndroidSdks; /** * Targeting is based on the user account region. */ regions?: Regions; /** * Target version codes as a list. */ versionList?: AppVersionList; /** * Target version codes as a range. */ versionRange?: AppVersionRange; } function serializeTargeting(data: any): Targeting { return { ...data, androidSdks: data["androidSdks"] !== undefined ? serializeAndroidSdks(data["androidSdks"]) : undefined, versionList: data["versionList"] !== undefined ? serializeAppVersionList(data["versionList"]) : undefined, versionRange: data["versionRange"] !== undefined ? serializeAppVersionRange(data["versionRange"]) : undefined, }; } function deserializeTargeting(data: any): Targeting { return { ...data, androidSdks: data["androidSdks"] !== undefined ? deserializeAndroidSdks(data["androidSdks"]) : undefined, versionList: data["versionList"] !== undefined ? deserializeAppVersionList(data["versionList"]) : undefined, versionRange: data["versionRange"] !== undefined ? deserializeAppVersionRange(data["versionRange"]) : undefined, }; } /** * Targeting information about the generated apks. */ export interface TargetingInfo { /** * List of created asset slices. */ assetSliceSet?: AssetSliceSet[]; /** * The package name of this app. */ packageName?: string; /** * List of the created variants. */ variant?: SplitApkVariant[]; } /** * Defines the scope of subscriptions which a targeting rule can match to * target offers to users based on past or current entitlement. */ export interface TargetingRuleScope { /** * The scope of the current targeting rule is any subscription in the parent * app. */ anySubscriptionInApp?: TargetingRuleScopeAnySubscriptionInApp; /** * 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; /** * The scope of the current targeting rule is the subscription in which this * offer is defined. */ thisSubscription?: TargetingRuleScopeThisSubscription; } /** * Represents the targeting rule scope corresponding to any subscription in the * parent app. */ export interface TargetingRuleScopeAnySubscriptionInApp { } /** * Represents the targeting rule scope corresponding to the subscriptions in * which this offer is defined. */ export interface TargetingRuleScopeThisSubscription { } /** * Update type for targeting. Note it is always a subset Targeting. */ export interface TargetingUpdate { /** * All users are targeted. */ allUsers?: AllUsers; /** * Additional android sdk levels are targeted by the recovery action. */ androidSdks?: AndroidSdks; /** * Additional regions are targeted by the recovery action. */ regions?: Regions; } function serializeTargetingUpdate(data: any): TargetingUpdate { return { ...data, androidSdks: data["androidSdks"] !== undefined ? serializeAndroidSdks(data["androidSdks"]) : undefined, }; } function deserializeTargetingUpdate(data: any): TargetingUpdate { return { ...data, androidSdks: data["androidSdks"] !== undefined ? deserializeAndroidSdks(data["androidSdks"]) : undefined, }; } /** * 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. */ export interface Testers { /** * All testing Google Groups, as email addresses. */ googleGroups?: string[]; } /** * Whether this subscription purchase is a test purchase. */ export interface TestPurchase { } /** * Represents texture compression format. */ export interface TextureCompressionFormat { /** * Alias for texture compression format. */ alias?: | "UNSPECIFIED_TEXTURE_COMPRESSION_FORMAT" | "ETC1_RGB8" | "PALETTED" | "THREE_DC" | "ATC" | "LATC" | "DXT1" | "S3TC" | "PVRTC" | "ASTC" | "ETC2"; } /** * Targeting by a texture compression format. */ export interface TextureCompressionFormatTargeting { /** * List of alternative TCFs (TCFs targeted by the sibling splits). */ alternatives?: TextureCompressionFormat[]; /** * The list of targeted TCFs. Should not be empty. */ value?: TextureCompressionFormat[]; } /** * 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. */ export interface Timestamp { /** * Non-negative fractions of a second at nanosecond resolution. Must be from * 0 to 999,999,999 inclusive. */ nanos?: number; /** * Represents seconds of UTC time since Unix epoch. */ seconds?: bigint; } function serializeTimestamp(data: any): Timestamp { return { ...data, seconds: data["seconds"] !== undefined ? String(data["seconds"]) : undefined, }; } function deserializeTimestamp(data: any): Timestamp { return { ...data, seconds: data["seconds"] !== undefined ? BigInt(data["seconds"]) : undefined, }; } /** * 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. */ export interface TokenPagination { /** * Tokens to pass to the standard list field 'page_token'. Whenever * available, tokens are preferred over manipulating start_index. */ nextPageToken?: string; previousPageToken?: string; } /** * A track configuration. The resource for TracksService. */ export interface Track { /** * In a read request, represents all active releases in the track. In an * update request, represents desired changes. */ releases?: TrackRelease[]; /** * Identifier of the track. Form factor tracks have a special prefix as an * identifier, for example `wear:production`, `automotive:production`. [More * on track * name](https://developers.google.com/android-publisher/tracks#ff-track-name) */ track?: string; } function serializeTrack(data: any): Track { return { ...data, releases: data["releases"] !== undefined ? data["releases"].map((item: any) => (serializeTrackRelease(item))) : undefined, }; } function deserializeTrack(data: any): Track { return { ...data, releases: data["releases"] !== undefined ? data["releases"].map((item: any) => (deserializeTrackRelease(item))) : undefined, }; } /** * Configurations of the new track. */ export interface TrackConfig { /** * Required. Form factor of the new track. Defaults to the default track. */ formFactor?: | "FORM_FACTOR_UNSPECIFIED" | "DEFAULT" | "WEAR" | "AUTOMOTIVE"; /** * Required. Identifier of the new track. For default tracks, this field * consists of the track alias only. Form factor tracks have a special prefix * as an identifier, for example `wear:production`, `automotive:production`. * This prefix must match the value of the `form_factor` field, if it is not a * default track. [More on track * name](https://developers.google.com/android-publisher/tracks#ff-track-name) */ track?: string; /** * Required. Type of the new track. Currently, the only supported value is * closedTesting. */ type?: | "TRACK_TYPE_UNSPECIFIED" | "CLOSED_TESTING"; } /** * Resource for per-track country availability information. */ export interface TrackCountryAvailability { /** * 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[]; /** * Whether artifacts in this track are available to "rest of the world" * countries. */ restOfWorld?: boolean; /** * 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?: boolean; } /** * A release within a track. */ export interface TrackRelease { /** * Restricts a release to a specific set of countries. */ countryTargeting?: CountryTargeting; /** * 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?: number; /** * 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; /** * A description of what is new in this release. */ releaseNotes?: LocalizedText[]; /** * The status of the release. */ status?: | "statusUnspecified" | "draft" | "inProgress" | "halted" | "completed"; /** * Fraction of users who are eligible for a staged release. 0 < fraction < 1. * Can only be set when status is "inProgress" or "halted". */ userFraction?: number; /** * Version codes of all APKs in the release. Must include version codes to * retain from previous releases. */ versionCodes?: bigint[]; } function serializeTrackRelease(data: any): TrackRelease { return { ...data, versionCodes: data["versionCodes"] !== undefined ? data["versionCodes"].map((item: any) => (String(item))) : undefined, }; } function deserializeTrackRelease(data: any): TrackRelease { return { ...data, versionCodes: data["versionCodes"] !== undefined ? data["versionCodes"].map((item: any) => (BigInt(item))) : undefined, }; } /** * Response listing all tracks. */ export interface TracksListResponse { /** * The kind of this response ("androidpublisher#tracksListResponse"). */ kind?: string; /** * All tracks (including tracks with no releases). */ tracks?: Track[]; } function serializeTracksListResponse(data: any): TracksListResponse { return { ...data, tracks: data["tracks"] !== undefined ? data["tracks"].map((item: any) => (serializeTrack(item))) : undefined, }; } function deserializeTracksListResponse(data: any): TracksListResponse { return { ...data, tracks: data["tracks"] !== undefined ? data["tracks"].map((item: any) => (deserializeTrack(item))) : undefined, }; } /** * Representation of a single country where the contents of a track are * available. */ export interface TrackTargetedCountry { /** * The country to target, as a two-letter CLDR code. */ countryCode?: string; } /** * Request message to update the state of a subscription base plan. */ export interface UpdateBasePlanStateRequest { /** * Activates a base plan. Once activated, base plans will be available to new * subscribers. */ activateBasePlanRequest?: ActivateBasePlanRequest; /** * Deactivates a base plan. Once deactivated, the base plan will become * unavailable to new subscribers, but existing subscribers will maintain * their subscription */ deactivateBasePlanRequest?: DeactivateBasePlanRequest; } /** * Request message for UpdateSubscriptionOffer. */ export interface UpdateSubscriptionOfferRequest { /** * Optional. If set to true, and the subscription offer with the given * package_name, product_id, base_plan_id and offer_id doesn't exist, an offer * will be created. If a new offer is created, update_mask is ignored. */ allowMissing?: boolean; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. The version of the available regions being used for the * subscription_offer. */ regionsVersion?: RegionsVersion; /** * Required. The subscription offer to update. */ subscriptionOffer?: SubscriptionOffer; /** * Required. The list of fields to be updated. */ updateMask?: string /* FieldMask */; } function serializeUpdateSubscriptionOfferRequest(data: any): UpdateSubscriptionOfferRequest { return { ...data, subscriptionOffer: data["subscriptionOffer"] !== undefined ? serializeSubscriptionOffer(data["subscriptionOffer"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeUpdateSubscriptionOfferRequest(data: any): UpdateSubscriptionOfferRequest { return { ...data, subscriptionOffer: data["subscriptionOffer"] !== undefined ? deserializeSubscriptionOffer(data["subscriptionOffer"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Request message to update the state of a subscription offer. */ export interface UpdateSubscriptionOfferStateRequest { /** * Activates an offer. Once activated, the offer will be available to new * subscribers. */ activateSubscriptionOfferRequest?: ActivateSubscriptionOfferRequest; /** * Deactivates an offer. Once deactivated, the offer will become unavailable * to new subscribers, but existing subscribers will maintain their * subscription */ deactivateSubscriptionOfferRequest?: DeactivateSubscriptionOfferRequest; } /** * Request message for UpdateSubscription. */ export interface UpdateSubscriptionRequest { /** * Optional. If set to true, and the subscription with the given package_name * and product_id doesn't exist, the subscription will be created. If a new * subscription is created, update_mask is ignored. */ allowMissing?: boolean; /** * Optional. The latency tolerance for the propagation of this product * update. Defaults to latency-sensitive. */ latencyTolerance?: | "PRODUCT_UPDATE_LATENCY_TOLERANCE_UNSPECIFIED" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_SENSITIVE" | "PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT"; /** * Required. The version of the available regions being used for the * subscription. */ regionsVersion?: RegionsVersion; /** * Required. The subscription to update. */ subscription?: Subscription; /** * Required. The list of fields to be updated. */ updateMask?: string /* FieldMask */; } function serializeUpdateSubscriptionRequest(data: any): UpdateSubscriptionRequest { return { ...data, subscription: data["subscription"] !== undefined ? serializeSubscription(data["subscription"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeUpdateSubscriptionRequest(data: any): UpdateSubscriptionRequest { return { ...data, subscription: data["subscription"] !== undefined ? deserializeSubscription(data["subscription"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Represents a targeting rule of the form: User currently has {scope} [with * billing period {billing_period}]. */ export interface UpgradeTargetingRule { /** * 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; /** * 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?: boolean; /** * Required. The scope of subscriptions this rule considers. Only allows * "this subscription" and "specific subscription in app". */ scope?: TargetingRuleScope; } /** * A user resource. */ export interface User { /** * Output only. The state of the user's access to the Play Console. */ readonly accessState?: | "ACCESS_STATE_UNSPECIFIED" | "INVITED" | "INVITATION_EXPIRED" | "ACCESS_GRANTED" | "ACCESS_EXPIRED"; /** * Permissions for the user which apply across the developer account. */ developerAccountPermissions?: | "DEVELOPER_LEVEL_PERMISSION_UNSPECIFIED" | "CAN_SEE_ALL_APPS" | "CAN_VIEW_FINANCIAL_DATA_GLOBAL" | "CAN_MANAGE_PERMISSIONS_GLOBAL" | "CAN_EDIT_GAMES_GLOBAL" | "CAN_PUBLISH_GAMES_GLOBAL" | "CAN_REPLY_TO_REVIEWS_GLOBAL" | "CAN_MANAGE_PUBLIC_APKS_GLOBAL" | "CAN_MANAGE_TRACK_APKS_GLOBAL" | "CAN_MANAGE_TRACK_USERS_GLOBAL" | "CAN_MANAGE_PUBLIC_LISTING_GLOBAL" | "CAN_MANAGE_DRAFT_APPS_GLOBAL" | "CAN_CREATE_MANAGED_PLAY_APPS_GLOBAL" | "CAN_CHANGE_MANAGED_PLAY_SETTING_GLOBAL" | "CAN_MANAGE_ORDERS_GLOBAL" | "CAN_MANAGE_APP_CONTENT_GLOBAL" | "CAN_VIEW_NON_FINANCIAL_DATA_GLOBAL" | "CAN_VIEW_APP_QUALITY_GLOBAL" | "CAN_MANAGE_DEEPLINKS_GLOBAL"[]; /** * Immutable. The user's email address. */ email?: string; /** * The time at which the user's access expires, if set. When setting this * value, it must always be in the future. */ expirationTime?: Date; /** * Output only. Per-app permissions for the user. */ readonly grants?: Grant[]; /** * Required. Resource name for this user, following the pattern * "developers/{developer}/users/{email}". */ name?: string; /** * 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. */ readonly partial?: boolean; } function serializeUser(data: any): User { return { ...data, expirationTime: data["expirationTime"] !== undefined ? data["expirationTime"].toISOString() : undefined, }; } function deserializeUser(data: any): User { return { ...data, expirationTime: data["expirationTime"] !== undefined ? new Date(data["expirationTime"]) : undefined, }; } /** * User entry from conversation between user and developer. */ export interface UserComment { /** * 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?: number; /** * Integer version code of the app as installed at the time the review was * written. May be absent. */ appVersionCode?: number; /** * String version name of the app as installed at the time the review was * written. May be absent. */ appVersionName?: string; /** * Codename for the reviewer's device, e.g. klte, flounder. May be absent. */ device?: string; /** * Information about the characteristics of the user's device. */ deviceMetadata?: DeviceMetadata; /** * The last time at which this comment was updated. */ lastModified?: Timestamp; /** * Untranslated text of the review, where the review was translated. If the * review was not translated this is left blank. */ originalText?: string; /** * 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; /** * The star rating associated with the review, from 1 to 5. */ starRating?: number; /** * 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; /** * Number of users who have given this review a thumbs down. */ thumbsDownCount?: number; /** * Number of users who have given this review a thumbs up. */ thumbsUpCount?: number; } function serializeUserComment(data: any): UserComment { return { ...data, lastModified: data["lastModified"] !== undefined ? serializeTimestamp(data["lastModified"]) : undefined, }; } function deserializeUserComment(data: any): UserComment { return { ...data, lastModified: data["lastModified"] !== undefined ? deserializeTimestamp(data["lastModified"]) : undefined, }; } /** * Describes an inclusive/exclusive list of country codes that module targets. */ export interface UserCountriesTargeting { /** * List of country codes in the two-letter CLDR territory format. */ countryCodes?: string[]; /** * Indicates if the list above is exclusive. */ exclude?: boolean; } /** * A set of user countries. A country set determines what variation of app * content gets served to a specific location. */ export interface UserCountrySet { /** * List of country codes representing countries. A Country code is * represented in ISO 3166 alpha-2 format. For Example:- "IT" for Italy, "GE" * for Georgia. */ countryCodes?: string[]; /** * Country set name. */ name?: string; } /** * Information specific to cancellations initiated by users. */ export interface UserInitiatedCancellation { /** * Information provided by the user when they complete the subscription * cancellation flow (cancellation reason survey). */ cancelSurveyResult?: CancelSurveyResult; /** * 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?: Date; } function serializeUserInitiatedCancellation(data: any): UserInitiatedCancellation { return { ...data, cancelTime: data["cancelTime"] !== undefined ? data["cancelTime"].toISOString() : undefined, }; } function deserializeUserInitiatedCancellation(data: any): UserInitiatedCancellation { return { ...data, cancelTime: data["cancelTime"] !== undefined ? new Date(data["cancelTime"]) : undefined, }; } /** * Additional options for Androidpublisher#usersList. */ export interface UsersListOptions { /** * The maximum number of results to return. This must be set to -1 to disable * pagination. */ pageSize?: number; /** * A token received from a previous call to this method, in order to retrieve * further results. */ pageToken?: string; } /** * Additional options for Androidpublisher#usersPatch. */ export interface UsersPatchOptions { /** * Optional. The list of fields to be updated. */ updateMask?: string /* FieldMask */; } function serializeUsersPatchOptions(data: any): UsersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeUsersPatchOptions(data: any): UsersPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * A permission used by this APK. */ export interface UsesPermission { /** * Optionally, the maximum SDK version for which the permission is required. */ maxSdkVersion?: number; /** * The name of the permission requested. */ name?: string; } /** * A multiple use, predefined promotion code. */ export interface VanityCode { /** * The promotion code. */ promotionCode?: string; } /** * APK that is suitable for inclusion in a system image. The resource of * SystemApksService. */ export interface Variant { /** * The device spec used to generate the APK. */ deviceSpec?: DeviceSpec; /** * Optional. Options applied to the generated APK. */ options?: SystemApkOptions; /** * Output only. The ID of a previously created system APK variant. */ readonly variantId?: number; } /** * Targeting on the level of variants. */ export interface VariantTargeting { /** * The abi that the variant targets */ abiTargeting?: AbiTargeting; /** * Multi-api-level targeting */ multiAbiTargeting?: MultiAbiTargeting; /** * The screen densities that this variant supports */ screenDensityTargeting?: ScreenDensityTargeting; /** * The sdk version that the variant targets */ sdkVersionTargeting?: SdkVersionTargeting; /** * Texture-compression-format-level targeting */ textureCompressionFormatTargeting?: TextureCompressionFormatTargeting; } /** * A VoidedPurchase resource indicates a purchase that was either * canceled/refunded/charged-back. */ export interface VoidedPurchase { /** * This kind represents a voided purchase object in the androidpublisher * service. */ kind?: string; /** * The order id which uniquely identifies a one-time purchase, subscription * purchase, or subscription renewal. */ orderId?: string; /** * The time at which the purchase was made, in milliseconds since the epoch * (Jan 1, 1970). */ purchaseTimeMillis?: bigint; /** * 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; /** * The voided quantity as the result of a quantity-based partial refund. * Voided purchases of quantity-based partial refunds may only be returned * when includeQuantityBasedPartialRefund is set to true. */ voidedQuantity?: number; /** * 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 8. Unacknowledged_purchase */ voidedReason?: number; /** * The initiator of voided purchase, possible values are: 0. User 1. * Developer 2. Google */ voidedSource?: number; /** * The time at which the purchase was canceled/refunded/charged-back, in * milliseconds since the epoch (Jan 1, 1970). */ voidedTimeMillis?: bigint; } function serializeVoidedPurchase(data: any): VoidedPurchase { return { ...data, purchaseTimeMillis: data["purchaseTimeMillis"] !== undefined ? String(data["purchaseTimeMillis"]) : undefined, voidedTimeMillis: data["voidedTimeMillis"] !== undefined ? String(data["voidedTimeMillis"]) : undefined, }; } function deserializeVoidedPurchase(data: any): VoidedPurchase { return { ...data, purchaseTimeMillis: data["purchaseTimeMillis"] !== undefined ? BigInt(data["purchaseTimeMillis"]) : undefined, voidedTimeMillis: data["voidedTimeMillis"] !== undefined ? BigInt(data["voidedTimeMillis"]) : undefined, }; } /** * Response for the voidedpurchases.list API. */ export interface VoidedPurchasesListResponse { /** * General pagination information. */ pageInfo?: PageInfo; /** * Pagination information for token pagination. */ tokenPagination?: TokenPagination; voidedPurchases?: VoidedPurchase[]; } function serializeVoidedPurchasesListResponse(data: any): VoidedPurchasesListResponse { return { ...data, voidedPurchases: data["voidedPurchases"] !== undefined ? data["voidedPurchases"].map((item: any) => (serializeVoidedPurchase(item))) : undefined, }; } function deserializeVoidedPurchasesListResponse(data: any): VoidedPurchasesListResponse { return { ...data, voidedPurchases: data["voidedPurchases"] !== undefined ? data["voidedPurchases"].map((item: any) => (deserializeVoidedPurchase(item))) : undefined, }; }